Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing a nested object in Laravel Blade

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!

enter image description here

like image 501
Gavin Kemp Avatar asked Sep 19 '25 18:09

Gavin Kemp


1 Answers

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 }}
like image 159
brunohdaniel Avatar answered Sep 21 '25 09:09

brunohdaniel