php - UnexpectedValueException 用户必须实现 CanResetPassword 接口
问题描述
我正在使用 laravel 6,我在重置密码时遇到问题,我进行了总和研究,但没有任何效果。他们中的大多数人告诉我添加 CanResetPassword,我已经添加了它但仍然没有。
这是我的 User.php 类
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
....
}
配置:身份验证
我刚刚添加了一个名为 password 的新提供程序,它使用 eloquent。我认为这可能是不好的做法,但它不再显示相同的错误。
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
'users' => [
'driver' => 'database',
'table' => 'users',
],
'password' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
],
'passwords' => [
'users' => [
'provider' => 'password',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
],
这是我添加密码提供程序之前的情况
'providers' => [
'users' => [
'driver' => 'database',
'table' => 'users',
],
'password' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
],
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
],
解决方案
推荐阅读
- javascript - 带对象的扩展运算符
- oracle - 在 oracle 中插入行时没有足够的值
- python - 使用欧几里得距离的推荐系统(TypeError: unsupported operand type(s) for -: 'str' and 'str')
- c# - 对 OData AttributeRouting 使用 ODataRoutePrefix 和 ODataRoute 不起作用
- javascript - 如何仅在 nextjs 的特殊组件中更改安装组件 css
- firebase - 对 null 的 UID 调用和提供者无法使用 TypeError 传递数据(类型“FirebaseUser”不是“String”类型的子类型)
- html - 我的图像没有水平居中,它也溢出了引导容器
- python - 如何在使用 xhtmltopdf 将 html 转换为 pdf 时使用边框半径
- elasticsearch - 如何从 kubernetes 卸载 ELK filebeat?
- file - Nginx - 在一个连接到同一个端口的 .conf 文件上运行两台服务器