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



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire