【发布时间】:2016-07-11 19:30:10
【问题描述】:
我正在使用 laravel 5.1 ResetsPasswords trait 来实现密码重置。我的用户模型称为“帐户”而不是“用户”。
当我输入我的电子邮件以获取密码重置链接时,我收到错误 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';
}
【问题讨论】:
-
你好@Duvdevan,我已经发布了示例模型代码
-
检查是否导入了 App\User 命名空间。阅读更多:laravel.com/docs/5.1/authentication#authentication-throttling.
标签: laravel laravel-5.1