I had this Error 500
inexplicable issue while upgrading from Laravel 5.2 to 5.3. No laravel error logs in storage/logs
, no Apache error logs. no issue with .env
, debug was turned on, no broken .htaccess
directives, plus php artisan
could not run. Tried everything until I looked in the PHP error logs and found:
PHP Fatal error: Uncaught Error: Undefined constant 'Illuminate\Auth\AuthenticationException' in C:\code\laravel-project\vendor\laravel\framework\src\Illuminate\Container\Container.php:79
So I did what @jon suggested and compared my Handler.php file with the fresh laravel one and found this:
In your App/Exceptions/Handler.php make sure that the classes in the $dontreport
array are referenced as either strings in quotes:
'\Illuminate\Auth\AuthenticationException',
'\Illuminate\Auth\Access\AuthorizationException',
'\Symfony\Component\HttpKernel\Exception\HttpException',
'\Illuminate\Database\Eloquent\ModelNotFoundException',
'\Illuminate\Session\TokenMismatchException',
'\Illuminate\Validation\ValidationException',
or this way:
\Illuminate\Auth\AuthenticationException::class,
\Illuminate\Auth\Access\AuthorizationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
For some reason I found mine to not have the quotes and fixing that got rid of the Error 500
.
use App\Exceptions\AuthenticationException;
at the beggining of the file that uses theAuthenticationException
, or change theAuthenticationException
to\App\Exceptions\AuthenticationException
where you use it inside your code. – Christos Lytrasapp/Http/Kernel.php
if thecan
middleware points to\Illuminate\Auth\Middleware\Authorize::class
defined inprotected $routeMiddleware
array like this'can' => \Illuminate\Auth\Middleware\Authorize::class
? – Christos Lytras'can' => \Illuminate\Auth\Middleware\Authorize::class,
– Alan