I tried to get data from pivot table as:
@foreach ($announcements as $index => $item)
{{dd($item->pivot->category->translate('en')->name)}}
{{dd($item->pivot->category->name)}}
@endforeach
I attached screenshot:
I tried to get data from pivot table as:
@foreach ($announcements as $index => $item)
{{dd($item->pivot->category->translate('en')->name)}}
{{dd($item->pivot->category->name)}}
@endforeach
I attached screenshot:
You shouldnot mention the model name:
{{dd($item->pivot->name)}}
if items and categories has a pivot table item_category with attribute name then, {{dd($item->pivot->name)}} gives the value of name attribute