Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 错误类用户包含1个抽象方法_Php_Laravel - Fatal编程技术网

Php 错误类用户包含1个抽象方法

Php 错误类用户包含1个抽象方法,php,laravel,Php,Laravel,我已经尝试了你在这两个论坛链接中看到的一切。没有人能够给出解决方案 我在db中添加了带有varchar 255和null的memore_令牌字段 我的表是正确命名的用户 为了让Auth工作,我在用户模型中添加了三个必需的函数 正如其他人所说,我所有的代码看起来都是正确的 以下是错误: Class User contains 1 abstract method and must therefore be declared abstract or implement the remaining

我已经尝试了你在这两个论坛链接中看到的一切。没有人能够给出解决方案

我在db中添加了带有varchar 255和null的memore_令牌字段

我的表是正确命名的用户

为了让Auth工作,我在用户模型中添加了三个必需的函数

正如其他人所说,我所有的代码看起来都是正确的

以下是错误:

Class User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Illuminate\Auth\UserInterface::getAuthIdentifier)

抽象方法的实现拼写错误:

getAuthIdentifier应该是getAuthIdentifier

…我假设您真的不打算创建方法GetAuthIdentifier

您应该继承getAuthIdentified,而是声明了一个带有输入错误的方法

/**
* Get the unique identifier for the user
*
* @return mixed
*/
public function getAuthIndentifier() 
{
    return $this->getkey();
}

识别器。IDE应该告诉您是否重写了一个方法,如果没有,您可能知道它不是重写,而是一个全新的方法。在Eclipse、NetBeans和PHPStorm中,类似于断点的彩色圆圈位于该行。

谢谢,这是一个简单的错误。这消除了错误,但是,由于在我的条件错误“电子邮件/密码错误,或帐户尚未激活?”中显示,身份验证仍然无法识别。我甚至把条件改为真或假,每次都会出现假。我的身份没有被识别。这是一个与你在这里提出的问题不同的问题。你应该接受答案,并用相关代码创建另一个问题。我已经这样做了,还没有答案。谢谢你,这修复了错误,但是我的授权仍然不起作用。请看@Ray post
 /**
  * Get the unique identifier for the user
  *
  * @return mixed
  */
  public function getAuthIndentifier() //<----bad spelling!!!!
  {
        return $this->getkey();
   }
/**
* Get the unique identifier for the user
*
* @return mixed
*/
public function getAuthIndentifier() 
{
    return $this->getkey();
}