Support the ongoing development of →
posted 6 years ago
Last updated 10 months ago.

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


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



Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

roshrnair roshrnair Joined 27 Sep 2016


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

Your logo here?

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

© 2023 - All rights reserved.