Question

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?

No correct solution

OTHER TIPS

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 {

}

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top