0
votes

I am using the laravel 5.1 ResetsPasswords trait to implement password reset. My user model is called "Account" instead of "User". When I input my email to get the password reset link, I get the error Class '\App\User' not found How can I make laravel know that my Model name is "Account"?

Sample Code

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';


    }
1
Hello @Duvdevan, I have posted sample model codeFokwa Best
Check if you have imported the App\User namespace. Read more on: laravel.com/docs/5.1/authentication#authentication-throttling.Zlatan Omerović

1 Answers

0
votes

Change the Authentication Model in the config/auth.php file.

/*
|--------------------------------------------------------------------------
| 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,

And the Authentication Table I guess.

/*
|--------------------------------------------------------------------------
| 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',