Level 3
Ok I found my error :
return redirect()->route( 'login' );
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all.
To handle TokenMismatchException I use this code (app/Exceptions/Handler.php) :
public function render( $request, Exception $exception )
{
if( $exception instanceof \Illuminate\Session\TokenMismatchException )
{
return redirect( $request->route( 'login' ) );
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
return parent::render( $request, $exception );
}
But his doesn't works, could you explain me why
Ok I found my error :
return redirect()->route( 'login' );
Please or to participate in this conversation.