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
How can we handle Error Handling in Laravel ?
What are the software’s included in laravel homestead?
What do you mean by view composers?
What is the use of php compact function?
What are named routes in laravel?
What is compact in laravel?
Is laravel an mvc framework?
What is composer in laravel?
List available types of relationships in laravel eloquent.
What is composer tool?
Explain laravel’s middleware?
What is a Artisan command ?
What is a primary implication of a cross site request forgery attack?
What the server requirements for laravel?
What is redis?