Laravel 5.2 – Undefined variable: errors

If you come across this little pig – Undefined variable: errors there is an easy fix. The reason for the error is that the errors middleware class is not picking up the route that contains the $error env variable. So, the solution is to wrap all of your routes in the middleware web array like so in your app/routes.php file:

  Route::group(['middleware' => ['web']], function() {
    // Paste routes here
  });

Also be sure to clear your config cache:

  php artisan config:cache

Reload and you should be ok. However in my case I got this error No supported encrypter found. The cipher and / or key length are invalid. If you get that read the solution here.