I've got this :
$location = \App\Location::find($location_id)->with('items','items.vendors')->get();
but its not using the find($location_id) and its returning all locations collections in the database. if I drop everything starting at ->with, it returns just a single location collection.
Am I doing something wrong with the syntax?
Try :
$location = \App\Location::with('items', 'items.vendor')->findOrFail($location_id);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community