I followed the documentation to try the notification system of Laravel 5.3, but I just cannot display the values of the "data" column (message and action).
In this column, the data is saved as json encoded array (?) in a text field:
{"message":"New comment on your photos.","action":"\/photos\/9372"}
How do I access these values in a blade view? This does not work:
@forelse($notifications as $n)
@php
$data = $n->data;
@endphp
{!! $data["message"] !!}
@empty
nothing
@endforelse
It says "index not found". I have tried lots of variants with json_decode and without, but can't get it to work.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community