Q:

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

I'm updating to Laravel 5.4 and am receiving the following error message when trying to display the login screen.
I'm receiving the following error message:

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

Here's is the AuthController class:
<?php

namespace App\Http\Controllers\Auth;

use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;

class AuthController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Registration & Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users, as well as the
    | authentication of existing users. By default, this controller uses
    | a simple trait to add these behaviors. Why don't you explore it?
    |
    */

use AuthenticatesAndRegistersUsers, ThrottlesLogins;

/**
 * Where to redirect users after login / registration.
 *
 * @var string
 */
protected $redirectTo = '/home';

/**
 * Where to redirect users after logout.
 *
 * @var string
 */
protected $redirectAfterLogout = '/login';

/**
 * Create a new authentication controller instance.
 *
 * @return void
 */
public function __construct()
{
    $this->middleware($this->guestMiddleware(), ['except' => ['getLogout']]);
}

/**
 * Get a validator for an incoming registration request.
 *
 * @param  array  $data
 * @return \Illuminate\Contracts\Validation\Validator
 */
protected function validator(array $data)
{
    return Validator::make($data, [
        'name' => 'required|max:255',
        'email' => 'required|email|max:255|unique:users',
        'password' => 'required|min:6|confirmed',
    ]);
}

/**
 * Create a new user instance after a valid registration.
 *
 * @param  array  $data
 * @return User
 */
protected function create(array $data)
{
    return User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'password' => bcrypt($data['password']),
    ]);
}
}

A:

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;
}

A:

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

A:

I think you need to use this trait instead
use Illuminate\Foundation\Auth\AuthenticatesUsers;

