Reputation: 85
I am getting the document saved with the user's information. Or sending document to email when I open email and click on link then I am getting error how to solve it. Error "Serialization of 'Closure' is not allowed";
What to do solve this issue.
Upvotes: 2
Views: 3285
Reputation: 21
I got this error when I tried to write to the session.
request()->session()->put('url.intended', url($slug));
but $slug was null, so just wrapped it in an if and that seemed to resolve the issue
Upvotes: 0
Reputation: 2488
Closures are PHP Code, which is not serializable by design, just like resources (open file pointers, database connections, ...).
You'll have to remove those things from your data structure before serializing it.
Upvotes: 2