Hello all, I have some model called location, which describe a location, (say the eiffel tower). This location has an album_id which corresponds to an album of photos. This album of photos has many photos throught a album_photos pivot table.
How can you go about it if you want to do something like
$location = Location::with('photos')->first();
I'm using https://github.com/Terumi/photogallery for the album
Thank you
Shouldn't you define the relation other way around, that Location has Album?
Nevertheless you can get photos with ease, but first elaborate how you want to use them so we can suggest the best way to go.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community