Solution
Run: composer require laravel/ui. But wait, read everything below first before you do!
References
Background of the error ‘trait “illuminate\foundation\auth\authenticatesusers” not found’
This might be different for you but just in case it’s the same, let’s review together.
I was working on an application that uses the Laravel Breeze package for authentication. The email login and register features already work perfectly but then, along the way, I needed social media login features on my application.
So I took a look at the Laravel Socialite package documentation and a few materials online and it’s so became necessary that I added some codes to my App/Http/Controllers/Auth/LoginController.php file. On checking through my files, the login file was missing. So, I copied it in from a previous Laravel project and made necessary modifications.
After all the modifications, I tried the social media button for login and then the error came.
What I did
In my case, I was not very keen on using the LoginController.php file. So, I moved the my new codes to the App/Http/Controllers/Auth/RegisteredUserController.php file and everything worked fine.
Final note
Worth noting is the fact that the Laravel files structure changes from version to version. So, some files might have moved or be absent on new versions. Adding missing core files in your Laravel version might require that you install some packages that will make such file compatible.
But of course, when it comes to Laravel controller files, any available file would work as long as it is referenced properly on the Routes/web.php file. The main essence of having multiple controller files is to make things organized and easy to find.
Found this helpful, feel free to let me know.