php - Laravel 8“我们找不到具有该电子邮件地址的用户。” 尝试重置密码时出错
问题描述
我昨天遇到了这个问题,我试图解决这个问题,但没有运气。我很困惑,这个函数来自 Laravel 默认,我没有更改代码,但即使电子邮件存在于数据库中,它也给了我这个错误。除此重置功能外,所有功能都很好。 我在数据库中也有一个用户表。
我已经通过检查核心 Laravel 代码(passwords.php、senpasswordresetsemail.php 等)完成了所有工作,但没有结果,这是我的用户迁移和我的用户模型代码。
用户迁移代码
public function up() {
Schema::create('users', function (Blueprint $table) {
$table->increments('user_id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->string('user_role')->nullable();
$table->integer('company_number')->nullable();
$table->string('project_id')->nullable();
$table->string('group_name')->nullable();
$table->timestamps();
});
}
用户型号代码
class User extends Authenticatable implements LdapAuthenticatable {
use HasFactory, Notifiable, PowerJoins, AuthenticatesWithLdap;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $primaryKey = 'user_id';
protected $fillable = [
'name',
'email',
'password',
'user_role',
'company_number',
'project_id',
'group_name',
];
/**
* 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',
];
public function companies() {
return $this->hasOne(Company::class, 'company_number', 'company_number');
}
}
任何形式的帮助将不胜感激,谢谢!:D
解决方案
推荐阅读
- bash - 在 Ubuntu 上解析病毒扫描结果
- encryption - 如何在wiremock独立服务器中启用ws策略读取和匹配Web服务请求?
- php - 如何让我的网站的访问者在不添加页面扩展名的情况下访问我的网页
- css - CSS 多列布局 - Chrome 不允许右列比左列长?
- wordpress - WooCommerce 中用于追加销售产品的光滑滑块
- node.js - 需要帮助部署使用 MongoDB Atlas 和 Express 创建的 RESTful API
- android - Android - 使用 Ejabberd 和 Smack 时出现文件传输错误
- c++ - 在 std::erase() 产生未定义的行为之前调用 std::fill() 吗?
- java - 添加一个新的drawable它正在改变解析的xml的图标
- jenkins - 如何使用 Prometheus Operator 抓取 Jenkins 指标