Answer the question
In order to leave comments, you need to log in
How to make a selection from tables in Laravel that are not directly related to each other?
So. The point is the following.
There are 4 tables
courses, lessons, messages, teachers
They are related as follows:
Lessons with messages are related as one to many (one lesson can have many messages)
Courses with lessons are related as one to many (a course has many lessons)
Teachers are related to Many-to-many courses (teachers can have many courses, and a course can have many teachers)
. there is still a lot of other garbage, I think the description above is enough.
Tell me how I can get all the comments from the lessons of a particular teacher as correctly as possible through Eloquent.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question