Php laravel中的通知-数据显示
我有个问题。我创建了一个通知系统,这样就可以将通知添加到表中:“通知”。开始时,我对用户进行了测试,它通过以下方式显示数据:Php laravel中的通知-数据显示,php,mysql,database,laravel,notifications,Php,Mysql,Database,Laravel,Notifications,我有个问题。我创建了一个通知系统,这样就可以将通知添加到表中:“通知”。开始时,我对用户进行了测试,它通过以下方式显示数据: @foreach(Auth::user()->notifications as $notification) <h5> {{ $notification->data['user_id']}}</h5> <p>{{ $notification->created_at->
@foreach(Auth::user()->notifications as $notification)
<h5> {{ $notification->data['user_id']}}</h5>
<p>{{ $notification->created_at->diffForHumans() }}</p>
@endforeach
如果我在视图中设置它,会弹出一个错误
{{$notification->data['player_id']}}
错误:未定义索引:player_id您好,
$notification->data
的输出是什么?我有错误:“htmlspecialchars()希望参数1是字符串,数组给定”。
{{$notification->data['player_id']}}