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 |
What is meant by Forms in Laravel ?
How can someone turn off csrf protection for a specific route?
What is laravel framework?
List the requirements to install valet?
What is :: in laravel?
How to create a laravel project using composer.
How to use multiple or condition in laravel query?
What is soft delete in laravel?
How to use ajax in any form submission?
What is service container in laravel?
How to use aggregate functions in laravel query?
Does wordpress use laravel?