Mar 3, 2017
0
Level 8
flash session error when redirecting to 404 page
Hello everybody. I have L5.3 installation. I made 404.blade.php in errors folder. In this blade I check errors like that:
@if (count($errors) > 0) ...
This construction works everywhere but when redirecting to 404 page I got error:
Undefined variable: errors
This error dissappear if in app/Http/Kernel.php in middleware array I add:
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
**\Illuminate\Session\Middleware\StartSession::class**,
**\Illuminate\View\Middleware\ShareErrorsFromSession::class**,
];
But in this case flashing session not working - no errors at all. So I'm asking someone may you also encountered this problem and solved it. Thanks for any hints.
Please or to participate in this conversation.