vendredi 27 juillet 2018

Laravel many to many relations query collection with

I have models:

User belongsToMany group belongsTo class belongsTo grade

Group belongsToMany user

when i do $group->user->with('class') i received an error that collection::with does not exist.

i am trying to achieve a collection of users that belong to the group with the one to many relation information. Any suggestions how this should be done?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2LSD02y
via IFTTT

Aucun commentaire:

Enregistrer un commentaire