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

laraman's avatar

PHP Fatal error in Laravel 5.3 route:scan command

I have replaced new auth controllers with old ones in Laravel 5.3 but when I run command => artisan route:scan It gives me this error:

`$ php artisan route:scan PHP Fatal error: Trait 'Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers' not found in C:\xampp\htdocs\blog\app\Http\Controllers\Auth\AuthController.php

[Symfony\Component\Debug\Exception\FatalErrorException] Trait 'Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers' not found`

It sounds it's looking for the old authController !

Any help woulld be appreciated.

0 likes
3 replies
ejdelmonico's avatar

You say it's looking for an old controller but the error message clearly states that a trait is missing. I would start there.

Snapey's avatar

You are saying you have copied the authController from an older version and put it in 5.3?

That older controller calls in the 'AuthenticatesAndRegistersUsers' trait, and this no longer exists in a 5.3 installation.

I suggest that you put the 5.3 auth controller back and just move over the bits of functionality you need from your original controller.

laraman's avatar

@ejdelmonico and @Snapey thanks for your answers. I fixed the error, It was due to not deleting the old auth controllers after upgrading Laravel 5.2 to 5.3 version.

simple and silly as that.

Please or to participate in this conversation.