I am developing one website with laravel

In which default users table I changed with another table name to user.

So How could I make relevant changes for the same to make authentication with user table rather than users table?

 

Bhaskar Monitor Asked on July 3, 2017 in Programming.
Add Comment
  • 1 Answer(s)

    Laravel takes default users table for an application.  To change with relevant table name we need to make a small change in authentication file of config.

    Go to
    config/auth.php

    
    
     'providers' => [
            // 'users' => [
            //     'driver' => 'eloquent',
            //     'model' => App\User::class,
            // ],
             'users' => [
                 'driver' => 'database',
                 'table' => 'user',
             ],
        ],

    this is above change for authentication for a signal table only.

    Now. if and only if we are using JWT token authentication in laravel. We need to make some changes for jwt authentication otherwise it will be not able to match with relevant users authentication tables.

    Now Go to

    config/jwt.php

    
    
    // here to give model path for authentication
    
    'user' => 'App\Models\User',
    
    

    Bhaskar Monitor Answered on July 3, 2017.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.