【发布时间】:2017-07-08 14:03:26
【问题描述】:
我已经安装了 Laravel 5.4 并使用了 php artisan make:auth。一切都很好,我设置了我的数据库并迁移了所有内容。我还测试了登录和注册,它运行良好。
之后,我设法设置了我的其他控制器和模型。在我测试了一个控制器之后(基本上,我将图像存储在数据库中,然后显示它)。它工作得很好,我存储了图像然后显示它。
但是,从那时起,当我尝试登录或注册时收到错误消息。
当我尝试访问 http://localhost:8000/login 或 http://localhost:8000/register 时,我收到以下错误:
调用未定义的方法 Illuminate\Database\Query\Builder::getAuthIdentifierName()
对于这个我不完全确定我应该分享我的代码的哪一部分,但这是我的 Modal User.php:
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\User;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $table = 'users';
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
}
提前谢谢你们,如果您需要我的代码的其他部分,我很乐意分享。
【问题讨论】:
-
分享你的路由和控制器文件