Reputation: 41
When login correct username & password then show error
ErrorException
Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must be an instance of Illuminate\Auth\UserInterface, instance of User given, called in E:\xampp\htdocs\laravel\vendor\laravel\framework\src\Illuminate\Auth\Guard.php on line 316 and defined
Anybody know where problem?
Upvotes: 1
Views: 1645
Reputation: 550
This error might also appear when you use a different model for users (example :member) if it's the case you need to update Authentication Model and Authentication Table in app/config/auth.php with the appropriate model / database table.
Upvotes: 0
Reputation: 87789
Your User model MUST implement UserInterface and its methods:
<?php namespace Illuminate\Auth;
interface UserInterface {
/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier();
/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword();
}
So it must declared as something like
use Illuminate\Auth\UserInterface;
class User extends Eloquent implements UserInterface {
}
Upvotes: 2