I've managed to change the password field in the code through overriding various classes/methods. But I after trying to override EloquentUserProvider and it's validateCredentials() method I keep getting an error -
ErrorException in AuthUserProvider.php line 11:
Argument 1 passed to App\Providers\AuthUserProvider::__construct() must be an instance of Illuminate\Contracts\Hashing\Hasher, instance of Illuminate\Foundation\Application given, called in /Users/Sagun/Sites/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146 and defined
I created an override App\Providers\AuthUserProvider.php - namespace App\Providers;
use Illuminate\Contracts\Auth\Authenticatable as UserContract;
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
use Illuminate\Auth\EloquentUserProvider;
class AuthUserProvider extends EloquentUserProvider {
public function __construct(HasherContract $hasher, $model)
{
parent::__construct($hasher, $model);
}
/**
* Validate a user against the given credentials.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param array $credentials
* @return bool
*/
public function validateCredentials(UserContract $user, array $credentials)
{
return true;
}
}
I'm guessing app\Providers isn't the namespace is requires but I also tried Illuminate\Auth as the namespace however that wouldn't work as well, as even after the declaration in app.config it failed to find the class. Or this file may need to be placed in a new directory?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1Tl8sI1
via IFTTT
Aucun commentaire:
Enregistrer un commentaire