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!
Solution:Jump to solution
For anyone searching something similar:
This plugin is awsome holy shit:
https://github.com/staudenmeir/eloquent-has-many-deep
...
GitHub
GitHub - staudenmeir/eloquent-has-many-deep: Laravel Eloquent HasMa...
Laravel Eloquent HasManyThrough relationships with unlimited levels - GitHub - staudenmeir/eloquent-has-many-deep: Laravel Eloquent HasManyThrough relationships with unlimited levels
2 Replies
I just found out laravel have, "hasManyThrough" Is this the correct approach? My idea is to define the relationship in classroom model and then creating relationship manager
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
GitHub
GitHub - staudenmeir/eloquent-has-many-deep: Laravel Eloquent HasMa...
Laravel Eloquent HasManyThrough relationships with unlimited levels - GitHub - staudenmeir/eloquent-has-many-deep: Laravel Eloquent HasManyThrough relationships with unlimited levels