Seems that you are trying to use a variable called errors in your view but you aren't passing the variable from the corresponding controller.
Undefined variable: $errors
Trying to learn Laravel, I just installed the latest version of Laravel. I'm relatively new to Laravel , and only tried using Laravel 4 for a very short time. But in version 4 I had no problems with outputting errors to a view, now in version 5.2 I'm getting :
Undefined variable: errors (View: /resources/views/home.blade.php)
I searched the web for a solution, and found that I had to change the kernel.php file...
from:
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\Illuminate\Session\Middleware\StartSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
],
'api' => [
'throttle:60,1',
],
];
To:
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
],
'api' => [
'throttle:60,1',
],
];
In my routes file I moved all routes within the "web" middleware group, as advised on several forums. But I still get an error, only a different one:
RuntimeException in Request.php line 852: Session store not set on request.
I'm not sure but it can't be the intention of the Laravel developers, that I have to modify core files to get my project working. So I must be doing something wrong. Does anyone have any idea how to solve this?
Please or to participate in this conversation.