In my database I have the following tables:
Document (idDoc, title, type)
Project (idProject, name)
DocumentProject (idDP, fk_Documento, fk_Proyecto)
I need to know how to do this with the Laravel ORM in a single consultation.
1.- Filter those documents whose type is 2 (int)
2.- Of the resulting documents, those who have the "Friends" project should be compared.
3.- The query should only give me the documents that have the project "Friends" and type 2.