samedi 27 mai 2017

notificaiton->data doesnt load in blade. Gives error of undefined index

This code gives me the values that i want. Data gives me the array of post and user.

Route::get('/test', function(){
    $user = App\User::find(1);
            $notifications=$user->unreadNotifications;
            foreach ($notifications as $notification) {
                dd($notification->data,$notification->data['post']['title']);
            }
            });

enter image description here

@foreach (auth()->user()->unreadNotifications as $notification)
             
@endforeach


Undefined index: user(View:E:\virtual\sichya2\resources\views\partials\replied_to_post.blade.php)

the loop gives me the error in view blade as show above



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2rtb7rE
via IFTTT

Aucun commentaire:

Enregistrer un commentaire