How to get Retrieving a Cookie in Laravel ?
Answer / rajani
Once we set the cookie, we can retrieve the cookie by cookie() method.
This cookie() method will take only one argument which will be the name of the cookie.
The cookie method can be called by using the instance of IlluminateHttpRequest.
Here is a sample code with explanation.
//’name’ is the name of the cookie to retrieve the value of
$value = $request->cookie('name');
Is This Answer Correct ? | 0 Yes | 0 No |
In laravel, what is guarded attribute in a model?
How much laravel experience do you have?
What are middleware groups?
How can I learn laravel fast?
What does csrf token in laravel 5?
How to stop valet?
Write a code to upload a file in laravel 5?
What is the best package to set up billing and subscription with stripe and braintree?
What is a Restful Resource Controllers ?
How many types of middleware are there in laravel?
What is the difference between facades vs helper functions?
How do I make all of my forms bootstrap opinionated?