1 year ago

Same Eloquent but different results ? What am i doing wrong

Posted 1 year ago by zaster

I have two views

view no 1

@foreach ($sub_jobs as $sub_job)

view no 2

@foreach ($jobs as $job)
                            @foreach ($job->sub_jobs as $sub_job)

view no 2 gives this error

Trying to get property 'name' of non-object

I did a {{dd($sub_job)}} and both views give the same result

Please sign in or create an account to participate in this conversation.