Issue
I have Ability
and Hero
models. The relation is many to many.
When I return collection I am able to use Hero::with('Abilities')->get()
Is there a way to achieve this with a single model (e.g. $hero->with('Abilities')->get()
)?
Solution
That will load a relation for a given model object:
$hero->load('Abilities');
Answered By - jedrzej.kurylo
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.