What would the Blade syntax be for retrieving the following from a query response? The data is eager loaded. Each image is linked to a separate table. How do you access an object within an object in Blade? Pretty new to Laravel. Thanks!
Controller
In your action you need to pass the data to the blade view:
return view('someview', compact('images'));//name of variable $images
View
Just use the variable:
@foreach($image as $image)
{{-- Do Something --}}
@endForEach
Once you pas them as data in your controller, inside your blade templates you should echo them as a objects:
{{ $images[0]->id }}
{{ $images[0]->host_image->path }}
Turns out you can't have underscores as the object names...