Support the ongoing development of Laravel.io →
Eloquent Blade

I have a object ($project) in Blade.

When I do a {{ var_dump($project) }} I get:

object(stdClass)[603]
  public 'image_header' => 
    array (size=1)
      0 => 
        object(stdClass)[610]
          public 'img' => string 'amsterdam.jpg' (length=13)

When I try to acces this element in blade with:

{{ $project->image_header[0]->img }}

It keeps giving this error Undefined offset: 0. I am really pulling my hair out here!

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Klaaz klaaz Joined 2 Sep 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.