Php SQLSTATE[42S22]:未找到列:在where子句中找到1054未知列“”(SQL:select*from`customer`where`=1限制1)
我已经更改了Laravel 5.8项目的身份验证表 但是,当我尝试登录时,出现以下错误: SQLSTATE[42S22]:未找到列:1054“where子句”中的未知列SQL:select*from customer where`=1 limit 1 下面是我的auth.php的外观:Php SQLSTATE[42S22]:未找到列:在where子句中找到1054未知列“”(SQL:select*from`customer`where`=1限制1),php,mysql,laravel,laravel-5,eloquent,Php,Mysql,Laravel,Laravel 5,Eloquent,我已经更改了Laravel 5.8项目的身份验证表 但是,当我尝试登录时,出现以下错误: SQLSTATE[42S22]:未找到列:1054“where子句”中的未知列SQL:select*from customer where`=1 limit 1 下面是我的auth.php的外观: 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => \App\Mode
'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()
如果我遗漏了任何我应该在问题中添加的内容,请提问,我将更新问题 这个函数getAuthIdentifierName应该返回列名,而不是我返回的实际值 所以它应该看起来像:
public function getAuthIdentifierName()
{
return 'customer_id';
}
经过几天的谷歌搜索,没有任何成功。最后你救了我的命。非常感谢。