How to set cookies in laravel 5 independently inside controller
You may try this:
Cookie::queue($name, $value, $minutes);
This will queue the cookie to use it later and later it will be added with the response when response is ready to be sent. You may check the documentation on Laravel
website.
Update (Retrieving A Cookie Value
):
$value = Cookie::get('name');
Note: If you set a cookie in the current request then you'll be able to retrieve it on the next subsequent request.
You are going right way my friend.Now if you want retrive cookie
anywhere in project just put this code $val = Cookie::get('COOKIE_NAME');
That's it!For more information how can this done click here