How to Accessing Session Data in Laravel ?
Answer / amit khanna
To access the session data, we need an instance of session which can be accessed via HTTP request.
After getting the instance, we can use the get() method, which will take one argument, key, to get the session data.
Syntax : $value = $request->session()->get('key');
You can use all() method to get all session data instead of get() method.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are view composers?
How will you explain dd() function in laravel?
What is auth?
What is the use of Laravel - Sending Email ?
How can we turn off csrf protection for a particular route?
What do you call a single quote?
What is monolog library in laravel?
What are the main differences between laravel 4 and laravel 5.x?
What is difference between php and laravel?
Is laravel easier than php?
Is laravel good for ecommerce?
How would you add a 3rd party package like sentry?