Level 51
if($request->hasCookie('uuid')) {
// do something
}
This works if you type hint $request in your controller, pretty sure you can also do
Request::hasCookie('uuid')
2 likes
Hi,
How do I check if a cookie exists or has been set before by Laravel?
Currently I am doing
$uuid = Request::cookie('uuid');
if ($uuid == "")
{
Do Something
}
is there a better way?
if($request->hasCookie('uuid')) {
// do something
}
This works if you type hint $request in your controller, pretty sure you can also do
Request::hasCookie('uuid')
Please or to participate in this conversation.