Model Relationships... Apartment has many Floorplan. Apartment has many Photo. Floorplan has many FloorplanImage.
I want to get all Apartment that have a Floorplan with 0 bedrooms. ALSO, I want to grab the related Photo, and related FloorplanImage.
My somewhat useless code...
$apartmentsWithStudios = Floorplan::with(['apartment', 'floorplanImage'])
->where('bedrooms', '=', 0)->get();
How do I grab the Apartment and all related models from querying the Floorplan model? Is it possible?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire