0

I've created a Laravel project in which I've run the following commands:

composer require laravel/ui

php artisan ui vue --auth

npm install

This sets up the controllers and a few other auth related files for the project. The second and third command are there to import vue into the project. Regardless, according to the Laravel docs, I've done what is needed to set up Auth for the project. To verify this, check out: https://laravel.com/docs/7.x/authentication

For some reason, after I serve up the app locally and try to either register a user or login a user, I get the following errors:

register: Illuminate\Contracts\Container\BindingResolutionException Target class [Auth\RegisterController] does not exist.

login: Illuminate\Contracts\Container\BindingResolutionException Target class [Auth\LoginController] does not exist.

Any thoughts? I can assure you that the class RegisterController.php does exist. Here's the photo example: enter image description here enter image description here

5
  • Did you clear Laravel cache? And composer dump-autoload -o ?
    – Ron
    Sep 8, 2020 at 23:44
  • well it should be App\Http\Controllers\Auth\RegisterController and App\Http\Controllers\Auth\LoginController ... Auth::routes() is in web.php? ... its almost like the auth routes were registered in a group that doesn't declare a namespace
    – lagbox
    Sep 9, 2020 at 0:59
  • 1
    this would make me assume you are using Laravel 8, not Laravel 7; in Laravel 8 your routes are not in a group with a namespace defined by default (in a fresh install)
    – lagbox
    Sep 9, 2020 at 7:56
  • 1
    stackoverflow.com/a/63807793/2109233
    – lagbox
    Sep 9, 2020 at 8:37
  • 1
    You're using Laravel 8, so make sure you're looking at the documentation for Laravel 8. Your question specifies you were looking at the docs for Laravel 7.
    – patricus
    Sep 10, 2020 at 12:36

0

Browse other questions tagged or ask your own question.