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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With