Answer Posted / amit khanna
The forget() method is used to delete an item from the session.
This method will take key as the argument.
Syntax : $request->session()->forget('key');
Use flush() method instead of forget() method to delete all session data.
Use the pull() method to retrieve data from session and delete it afterwards.
The pull() method will also take key as the argument.
The difference between the forget() and the pull() method is that forget() method will not return the value of the session and pull() method will return it and delete that value from session.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Please provide steps to configure homestead?
What is views in laravel?
What is laravel api?
What is api php in laravel?
What is reverse path multicasting?
What is service container?
What are system requirement for laravel 5.0?
How to set cookies in laravel?
How do I know laravel version?
What is laravel horizon?
What are deferred providers in laravel?
Is laravel good for api?
What is laravel quora?
What do you understand by database migrations in laravel? How can we use it?
How to use cookies in laravel?