lundi 4 janvier 2016

multiple authentication login error

i am doing multi authentication my front end has a login form with cardno and password. in auth.php

return [
        'multi' => [
            'users' => [
                'driver' => 'eloquent',
                'model'  => App\User::class,
                'table'  => 'users'
            ],
            'frontendUsers' => [
                'driver' => 'eloquent',
                'model'  => App\loginModel::class,
                'table'  => 'frontend_users'
            ]
         ],
         'password' => [
                'email' => 'emails.password',
                'table' => 'password_resets',
                'expire' => 60,
            ],
        ];

in logincontroller,

// attempt to do the login
if (\Auth::attempt('frontendUsers', ['cardno' => '111111', 'password' => '999087787'])) {
       echo "login";
}
else {
        echo "failed";
}

when i try to log in i get this error

ErrorException in EloquentUserProvider.php line 110: Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\loginModel given, called in C:\xampp\htdocs\elitecard\vendor\laravel\framework\src\Illuminate\Auth\Guard.php on line 390 and defined



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1mxJJ5k
via IFTTT

Aucun commentaire:

Enregistrer un commentaire