【发布时间】:2019-12-25 11:37:41
【问题描述】:
我已更改 Laravel 5.8 项目的身份验证表。
但是当我尝试登录时,我收到以下错误:
SQLSTATE[42S22]:未找到列:1054 'where 子句'中的未知列''(SQL:select * from customer where ``= 1 limit 1)
这就是我的 auth.php 的样子:
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => \App\Models\Sop\Customer::class
]
]
客户模型类:
class Customer extends Model implements Authenticatable
{
protected $table = "customer";
protected $primaryKey = 'customer_id';
protected $connection = "sop";
protected $fillable = [
'customer_ref',
'customer_status_id',
'registration_level',
'email_address',
'username',
'password',
'verification_code'
];
public function getAuthIdentifier()
{
return $this->customer_id;
}
public function getAuthPassword()
{
return $this->password;
}
public function getRememberToken()
{
if (!empty($this->getRememberTokenName())) {
return $this->{$this->getRememberTokenName()};
}
}
public function setRememberToken($value)
{
if (!empty($this->getRememberTokenName())) {
$this->{$this->getRememberTokenName()} = $value;
}
}
public function getRememberTokenName()
{
return $this->remember_token;
}
/**
* Get the name of the unique identifier for the user.
*
* @return string
*/
public function getAuthIdentifierName()
{
return $this->customer_id;
}
}
但是,当尝试上传时,调用此行时会出错:
Auth::check()
如果我错过了应该在问题中添加的任何内容,请提出,我会更新问题。
【问题讨论】:
标签: php mysql laravel laravel-5 eloquent