Support the ongoing development of Laravel.io →
posted 7 years ago
Eloquent
Last updated 1 year ago.
0

All the offices has a parent? I can imagine that the parent is field can be null

So what you need to do is use the or inside the view, like this

{{ $office_type->office_type->name or ""}}

I suggest to follow the laravel standards in terms of method naming methods should be on camel case

0

Thank you for the response. An office may or may not have a parent. I will try out your suggestion and revert.

Thanks

0

Sign in to participate in this thread!

Eventy

Your banner here too?

roshrnair roshrnair Joined 27 Sep 2016

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.

© 2024 Laravel.io - All rights reserved.