Level 15
@dd(\Cookie::get('trophylist')
Should dump the value in the blade file. Or just check your browser dev tools for the cookie
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a cookie called: trophylist by default its value is 'list' when I press a button it becomes grid.
how do I check the value inside the cookie? I did this, but it doesn't work
@if (\Cookie::get('trophylist') == 'list')
@include('front.component.trofei.table')
@else
aaaaaaaaa
@endif
now the cookie content is 'list' and it shows me 'aaaaaaaaaa', why?
I tried to put:
@dd(\Cookie::get('trophylist')
and it prints me on the blade exactly
(\Cookie::get('trophylist')
i am using Laravel 5.8
Edit:
was missing one ), I print null.
Another Edit:
I solved it by inserting the name of the cookie in Http\Middleware\EncryptCookies.php
Please or to participate in this conversation.