jeudi 27 août 2015

Is it possible to get relation by parameter?

For example I have model Class and model Pupil. Class -> hasMany[Pupil] and each Pupil -> belongsTo[Class]. Is it possible somehow with default Eloquent methods get all classes where pupil with name mike exists? I need to select this exactly from Class model. P.S. Yes, i could add scope with joins, but i dont want to reinvent the wheel. May be some methods for this already exists ?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1F09PjJ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire