Laravel: Trait 'Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers' not found

If you're in Laravel 7+, you'll need to first install the laravel/ui package (since this contains auth backend code) by running the following command:

$composer require laravel/ui

and then

<?php

use Illuminate\Foundation\Auth\RegistersUsers;

class RegisterController extends Controller
{
    use RegistersUsers;
}

with laravel 5.4 we have some changes in this trait. Now we have two different traits:

use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

And if you install a fresh 5.4 laravel application you will see that now you have LoginController and RegisterController instead of AuthController


I think you need to use this trait instead

use Illuminate\Foundation\Auth\AuthenticatesUsers;