Support the ongoing development of Laravel.io →
Configuration Authentication
Last updated 2 years ago.
0

Try following laravel naming conventions. User class uses users table. Don't start mixing if you are not working with an existing database.

0

LaurentMeganck said:

Try following laravel naming conventions. User class uses users table. Don't start mixing if you are not working with an existing database.

That didn't work. Steps to reproduce.

  1. Fresh laravel install
  2. Alter .env with correct DB and credentials
  3. run [php artisan make:auth]
  4. run [php artisan migrate]
  5. go to database tool and copy the users table to another table - say login
  6. alter the App\User.php file with protected $table = "login".
  7. register via the web interface and you'll see that your new registered user is in the newly copied table (e.g. login)... Sweet right?
  8. drop the users table in the database
  9. attempt to register a new user again via the web interface and you'll get a SQL error complaining that the users table doesn't exist.
Last updated 8 years ago.
0

solution was in the auth controller - on the email field there was a unique:users attribute and I changed it to the correct table name

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.