The ViewErrorBag
is empty because session is not start in the Handler
. Solution was previously described by @Talinon at Laracast
To make session available in the Handler
class, I moved IlluminateFoundationHttpMiddlewareValidatePostSize::class
from $middleware
to $middlewareGroups
array at the App/Http/Kernel.php
My updated $middlewareGroups
array looks like:
protected $middlewareGroups = [
'web' => [
AppHttpMiddlewareEncryptCookies::class,
IlluminateCookieMiddlewareAddQueuedCookiesToResponse::class,
IlluminateSessionMiddlewareStartSession::class,
IlluminateFoundationHttpMiddlewareValidatePostSize::class, // <<< this line was added
IlluminateViewMiddlewareShareErrorsFromSession::class,
AppHttpMiddlewareVerifyCsrfToken::class,
IlluminateRoutingMiddlewareSubstituteBindings::class,
],
...
];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…