Level 3
nobody?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi there, im having a trouble with use of Laravel Session componnent, my page 404 (error) needs to extend the default template, and the default template uses session values.
I know its possible to listen the event inside this method, but there isnt any way to use session() helper inside 404.blade.php =/
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
if($exception instanceof NotFoundHttpException){
return response()->view('errors.404', [], 404);
}
return parent::render($request, $exception);
}
Can someone help me to get a instance of session there?.
Please or to participate in this conversation.