“拉雷维尔”;User.php第8行中的FatalErrorException:“;
这意味着什么,我该如何修复它“拉雷维尔”;User.php第8行中的FatalErrorException:“;,php,laravel,authentication,laravel-5,laravel-5.2,Php,Laravel,Authentication,Laravel 5,Laravel 5.2,这意味着什么,我该如何修复它 FatalErrorException in User.php line 8: Class App\User contains 6 abstract methods and must therefore be declared abstract or implement the remaining methods (Illuminate\Contracts\Auth\Authenticatable::getAuthIdentifierName, Illuminate
FatalErrorException in User.php line 8:
Class App\User contains 6 abstract methods and must therefore be declared abstract or implement the remaining methods (Illuminate\Contracts\Auth\Authenticatable::getAuthIdentifierName, Illuminate\Contracts\Auth\Authenticatable::getAuthIdentifier, Illuminate\Contracts\Auth\Authenticatable::getAuthPassword, ...)
这是在我尝试登录laravel应用程序的仪表板时发生的。这是关于接口实现的。如果要实现该接口,需要提及接口声明的所有方法 照亮\Contracts\Auth\authenticable 接口定义:
interface Authenticatable {
public function getAuthIdentifierName();
public function getAuthIdentifier();
public function getAuthPassword();
public function getRememberToken();
public function setRememberToken($value);
public function getRememberTokenName();
}
因此,您的用户类必须具有上述方法
class User implements Illuminate\Contracts\Auth\Authenticatable
{
public function getAuthIdentifierName() {}
public function getAuthIdentifier(){}
public function getAuthPassword(){}
public function getRememberToken(){}
public function setRememberToken($value){}
public function getRememberTokenName(){}
}
即使您不想在这些方法中编写代码,但仍然需要在用户类中编写空方法
解决方案:
你能发布User.php类吗?看起来您的类没有实现抽象类中的某些方法。