Support the ongoing development of Laravel.io →
Authentication Database

Hello everybody, I'm new with laravel and I never used any php framework, so I'm a little lost. Actually, I have a mysql database withs few tables, and particularly the tables : user, userrole and role. Thoses tables contain data.
Yesterday, I started on Laravel 5.2 and I see that there is a authentication service, I read the documentation and I did 'php artisan make:auth' but now :

  • I see a class CreateUsersTable extends Migration which if I understand will create a table named 'users' when I will make the 'php artisan migrate' and I don't know how the authentication service use this table to do registration etc.
  • I want the authentication service to uses my table user to make authentication instead of the table users

Thank you a lot !!!

Last updated 3 years ago.
0
Solution

To authenticate users, check out the (documentation)[https://laravel.com/docs/5.2/authentication]

        if (Auth::attempt(['email' => $email, 'password' => $password])) {
            // Authentication passed...
            return redirect()->intended('dashboard');
        }

authentication service to uses my table user to make authentication instead of the table users

Regarding the table name, you change it in your (model)[https://laravel.com/docs/5.2/eloquent]


class Flight extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'my_flights';

Hope that helps.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Khoya91170 khoya91170 Joined 10 Jun 2016

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.

© 2025 Laravel.io - All rights reserved.