count() 参数必须是在 laravel 中实现可数的数组或对象
这是这里的代码:
protected function credentials(Request $request)
{
$admin=admin::where('email',$request->email)->first();
if(count($admin))
{
if($admin->status==0){
return ['email'=>'inactive','password'=>'You are not an active person, Please contact to admin'];
}
else{
return ['email'=>$request->email,'password'=>$request->password,'status'=>1];
}
}
return $request->only($this->username(), 'password');
}
当我运行代码时,此错误变为:
“count():参数必须是实现 Countable 的数组或对象”