Answer the question
In order to leave comments, you need to log in
How in Laravel 5.1 will save data to session from Exception Handler?
Hey! Please help, can anyone come across, the problem is the following (Laravel 5.1):
I'm trying to change the behavior when throwing TokenMismatchException in this way: in Exceptions/Handler.php:
public function render($request, Exception $e)
{
if ($e instanceof TokenMismatchException){
session()->put('put', 'qwe');
return redirect()->route('test1')->with('with', 'sad');
}
return parent::render($request, $e);
}
Answer the question
In order to leave comments, you need to log in
So there was a bug in Laravel, it was fixed. Update to 5.2 or see changelog from 5.1 to 5.2 and fork or offer a backport in 5.1.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question