Laravel 5 如何在laravel中从主键中删除前缀
我有users表,其中包含UserId作为主键,但当我进行用户身份验证时,它使用“users.user\u UserId” 那么,如何从主键中删除“user_u3;”前缀呢 型号:Laravel 5 如何在laravel中从主键中删除前缀,laravel-5,Laravel 5,我有users表,其中包含UserId作为主键,但当我进行用户身份验证时,它使用“users.user\u UserId” 那么,如何从主键中删除“user_u3;”前缀呢 型号: class User extends Authenticatable { use Notifiable; /** * The attributes that are mass assignable. * * @va
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $table = 'Users';
protected $primaryKey = 'UserId';
}
在提供者数组中的config/auth.php中,取消对第73行的用户的注释
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
'users' => [
'driver' => 'database',
'table' => 'users',
],
],