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?
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',