Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Lara1's avatar
Level 1

How solve Exception Handler in Laravel 6?

ErrorException: Declaration of App\Exceptions\Handler::unauthenticated($request, App\Exceptions\AuthenticationException $exception) should be compatible with Illuminate\Foundation\Exceptions\Handler::unauthenticated($request, Illuminate\Auth\AuthenticationException $exception) in file C:\xampp\htdocs\learnlara\app\Exceptions\Handler.php on line 9

0 likes
2 replies
bobbybouwmann's avatar

Are you upgrading Laravel to a new version? If so go to the laravel/laravel repository and copy the app/Exceptions/Handler.php file to your project. Then everything should be good.

The problem here is that you override the class, but you give it another dependency than the parent class. These two need to match!

1 like
Lara1's avatar
Level 1

Thank You #bobbybouwhuman

Please or to participate in this conversation.