Reputation: 5283
I have users table which contains UserId as primary key but when I user Authentication it uses "Users.user_UserId" so how do i remove "user_" prefix from primary key?
Model:
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $table = 'Users';
protected $primaryKey = 'UserId';
}
Upvotes: 1
Views: 474
Reputation: 26
In config/auth.php in provider array uncomment the user at line number 73.
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
'users' => [
'driver' => 'database',
'table' => 'users',
],
],
Upvotes: 1