Support the ongoing development of Laravel.io →
Eloquent Views Blade
Last updated 2 years ago.
0

Not quite sure if it is what you want?

{{ isset($this->category->parent_id)?  $categories[$product->category->parent_id] : '' }} / {{ $product->category->name }}
Last updated 2 years ago.
0

duh - yeah exactly, new i was being stupid.

One thing thats now puzzling me is this An example {{ $product->category->parent_id }} = 4

my categories are so #1 1 "Pergolenxy"
#2 2 "Zelten"
#3 3 "Markisen"
#4 4 "Markilux" #5 5 "Side Blinds"

Yet for some reason when i do this $categories[$product->category->parent_id]['name']

I get "Side Blinds" instead of "Markilux", which seems a bit bizarre

  • i'm obviously grabbing the array index(starts at 0) and not the object id

Any suggestions ?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

nousename nousename Joined 23 Apr 2014

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.