laravel - Laravel - BadMethodCallException 调用未定义的方法 App\User::getAuthIdentifierName()
问题描述
我知道这个问题已经被问过很多次了,但是给出的答案都没有帮助。部分原因是因为大多数答案都说要做已经完成的事情。每个页面都给出错误:“BadMethodCallException 调用未定义的方法 App\User::getAuthIdentifierName()”。
这就是发生的事情。身份验证运行良好。然后我做了一个新的迁移:
php artisan migrate:fresh --seed
之后,错误出现。
这是我的应用程序/用户模型代码:
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use jeremykenedy\LaravelRoles\Traits\HasRoleAndPermission;
use Illuminate\Database\Eloquent\SoftDeletes;
class User extends Authenticatable implements MustVerifyEmail
// class User extends Authenticatable
{
use SoftDeletes;
use Notifiable;
use HasRoleAndPermission;
protected $dates = ['deleted_at'];
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}
我已经尝试运行php artisan ui vue --auth
并输入“是”所有覆盖问题,但这没有用。
任何有关其他可能导致此问题的帮助将不胜感激。
编辑:仅供参考,我唯一更改为重新迁移的是几个种子文件。
解决方案
推荐阅读
- r - 不要用 ggplot2 绘制一些计数
- c++ - Windows 中的 pthread_cond_timedwait()
- python - PyYAML 在不同的操作系统中表现不同
- apache-kafka - Spring Kafka - 消费者、容器和监听器
- windows - Word VBA - 表合并问题
- node.js - 在 src中定义的图像未显示在我的 heroku 应用程序上
- hyperledger-explorer - 启动超级账本资源管理器失败
- exact-online - itgendch033:后备数据库需要 Invantive Data Replicator 将“ExactOnlineXML.XML.SubscriptionLines”的列数限制为 1,000
- postgresql - 如何使用 PSQL 运行和自动创建数据库
- php - PHP 正则表达式接受日语和英语语言