我正在使用laravel 5.1 ResetsPasswords特性来实现密码重置。我的用户模型称为“帐户”而不是“用户”。
当我输入我的电子邮件以获取密码重置链接时,我收到错误Class '\App\User' not found
如何让laravel知道我的模型名称是“帐户”?
示例代码
Account.php
class Account extends \Eloquent implements AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract
{
use Authenticatable, Authorizable, CanResetPassword;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'accounts';
}
答案 0 :(得分:0)
更改config / auth.php文件中的身份验证模型。
/*
|--------------------------------------------------------------------------
| Authentication Model
|--------------------------------------------------------------------------
|
| When using the "Eloquent" authentication driver, we need to know which
| Eloquent model should be used to retrieve your users. Of course, it
| is often just the "User" model but you may use whatever you like.
|
*/
'model' => App\User::class,
我猜认证表。
/*
|--------------------------------------------------------------------------
| Authentication Table
|--------------------------------------------------------------------------
|
| When using the "Database" authentication driver, we need to know which
| table should be used to retrieve your users. We have chosen a basic
| default value but you may easily change it to any table you like.
|
*/
'table' => 'users',