Sunday, March 8, 2015

[Laravel 4][Resolved] Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must be an instance of Illuminate\Auth\UserInterface, instance of User given

Detailed error message:

ErrorException (E_UNKNOWN)
Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must be an instance of Illuminate\Auth\UserInterface, instance of User given, called in C:\wamp\www\ laravel\vendor\laravel\framework\src\Illuminate\Auth\Guard.php on line 378 and defined

Go to your related model and imports the “Illuminate\Auth\UserInterface” namespace (or class) to the your scope and implementing the “UserInterface” interface.

Change from
class User extends Eloquent {
to
use Illuminate\Auth\UserInterface;
class User extends Eloquent implements UserInterface {

Reference:
https://github.com/ollieread/multiauth/issues/45
http://stackoverflow.com/questions/10965454/how-does-the-keyword-use-work-in-php-and-can-i-import-classes-with-it

No comments :

Post a Comment