mardi 12 juin 2018

Eloquent query that queries based on a relationship with a relationship

Trying to describe my problem in the title was difficult. What I mean is this. I have 3 tables. Job, Diary, Document. Each diary entry has a belongsTo relationship with Job. Each Document has a belongsTo relationship with Diary.

How can I query Documents so it returns all the documents belonging to a single job.

Document->diary_id references Diary->id - Diary->job_number_id references Job->id

Both these individual relationships are set up and work.

I have tried different queries with no success.

Any help appreciated. Regards Finchy70



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire