我得到以下错误
在非对象上调用成员函数 isClient()
什么时候发生?
我有一个发布路线http://localhost/auth/logout
当我按下注销按钮时,就会调用这个操作方法。
下面是我的用户模型
class User_Model extends Model implements AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract
{
use Authenticatable, Authorizable, CanResetPassword;
protected $table = 'tblusers';
protected $fillable = ['UserName', 'EmailAddress', 'Password', 'RoleID', 'IsActive'];
protected $hidden = ['Password', 'remember_token'];
protected $primaryKey = "UserID";
public function isClient()
{
return $this->RoleID == \App\Enumeration\Role\RoleType::Client ? 1 : 0;
}
}
下面是我的 route.php 文件
<?php
Route::group(['middleware' => 'web'], function() {
Route::get('/View-Profile', 'User\Account_Controller@ViewProfile');
Route::get('/auth/logout', 'Auth\AuthController@getLogout');
});
问题
我错过了什么吗?