Reputation: 3002
I have a request in laravel which is I needed to store in session what I'm try to do is store all the request in a session to lesson the coding which is this one:
public function store(Request $request)
{
session()->put('quotation', $request);
return 'success';
}
What it does is it is storing all the request to session but I am encountering an error
(1/1) Exception Serialization of 'Closure' is not allowed
I'm using laravel 5.4
Upvotes: 0
Views: 7590
Reputation: 50481
The Request object has Closures as properties. You probably don't need the entire Request object but only the inputs. If you only need the inputs you can save the array of inputs:
$request->session()->put('quotation', $request->input());
quotation
will contain an array of the inputs.
Upvotes: 5