I have created notification to store order submit event as
return [
'cart_id'=>$this->cart->id,
'text'=>'order is submitted'
];
when i retrieve notifications data from database as
@foreach (Auth::user()->unreadNotifications as $notification )
{{$notification->data['text'] }}
@endforeach
this gives error as undefined index text
but if i try to access text via
@foreach ($notification->data as $key => $data)
{{$data}}
@endforeach
it works
but why cant i can access data via $notification->data['text']