Show Parent Relationship.
Hi guys, I need a little help figuring this out.
The title might be a bit misleading, I just cannot word it better.
I have 3 Model
Model Level -> hasmany Model Project
Model Level -> hasmany Model Classroom
Now in the classroom edit page, I want to show all the project that the classroom inherit from its level.
How should I approach this?
Thanks!
The title might be a bit misleading, I just cannot word it better.
I have 3 Model
Model Level -> hasmany Model Project
Model Level -> hasmany Model Classroom
Now in the classroom edit page, I want to show all the project that the classroom inherit from its level.
How should I approach this?
Thanks!
Solution
For anyone searching something similar:
This plugin is awsome holy shit:
https://github.com/staudenmeir/eloquent-has-many-deep
It handles every complex relationship
This plugin is awsome holy shit:
https://github.com/staudenmeir/eloquent-has-many-deep
It handles every complex relationship
GitHub
Laravel Eloquent HasManyThrough relationships with unlimited levels - GitHub - staudenmeir/eloquent-has-many-deep: Laravel Eloquent HasManyThrough relationships with unlimited levels