当尝试显示json数据时,它会提供Undefined index:user exception
foreach(auth()->user()->unreadnotifications as $notifications)
@include('frontend.common.notification.'.snake_case(class_basename($notifications->type)))
@endforeach
包含的视图代码是
<div>
<i class="fa fa-comment fa-fw"></i>
<img src="{{url('images/account/'.$notifications->data['user']['currentimage'])}}" height="50px" width="50"/>
{{$notifications->data['user']['email']}} commented on your post.
<span class="pull-right text-muted small">{{$notifications->created_at->diffForHumans()}}</span>
</div>
Json对象
{&#34;评论&#34;:{&#34;评论&#34;:&#34;我很棒&#34;,&#34; user_id&#34;:2,&#34; post_id& #34;:&#34; 2&#34;,&#34; commment_rate&#34;:90,&#34; updated_at&#34;:&#34; 2017-07-06 16:32:07&#34; ,&#34; created_at&#34;:&#34; 2017-07-06 16:32:07&#34;,&#34; id&#34;:18},&#34; user&#34;:{ &#34; ID&#34;:2&#34;电子邮件&#34;:&#34; test2@mail.com",&#34; currentimage&#34;:&#34; 1499004938.jpg&# 34;,&#34;作用&#34;:0,&#34;验证&#34;:空,&#34;封端的&#34;:空,&#34; created_at&#34;:&#34; 2017年-07-02 13:44:24&#34;,&#34; updated_at&#34;:&#34; 2017-07-02 14:15:38&#34;}}
答案 0 :(得分:0)
在查看代码后,我假设您在集合中使用了foreach循环。
setInterval(function(){
googletag.pubads().refresh(null, {changeCorrelator: false});
}, 30000);