samedi 15 octobre 2016

How to chain eloquont relations in laravel?

So far I was extracting the relation objects as arrays and then doing something like:

App\Model::find($id)

But however is there a way to do something like:

Auth::user()->group()->members()

It works until Auth::user()->group but no further chaining. Please help if you've done something. Or I'm just newbie.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire