2016-03-24 13 views
0

私はlaravel 5.1 ResetsPasswords特性を使用してパスワードリセットを実装しています。私のユーザーモデルは「ユーザー」ではなく「アカウント」と呼ばれます。 メールを入力してパスワードリセットリンクを取得すると、エラーが発生しますClass '\App\User' not found 私のモデル名が「アカウント」であることをlaravelに知らせるにはどうすればよいですか?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

コードを投稿してください。 – omerowitz

+0

Hello @Duvdevan、サンプルコード –

+0

を投稿しました。App \ User名前空間をインポートしたかどうかを確認してください。詳細はhttps://laravel.com/docs/5.1/authentication#authentication-throttlingをご覧ください。 – omerowitz

答えて

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', 
+0

おかげで@J。 Eggerstedt。できます。 –

関連する問題