W3cubDocs

/Laravel 5.8

EloquentUserProvider

class EloquentUserProvider implements UserProvider (View source)

Properties

protected Hasher $hasher The hasher implementation.
protected string $model The Eloquent user model.

Methods

void __construct(Hasher $hasher, string $model)

Create a new database user provider.

Authenticatable|null retrieveById(mixed $identifier)

Retrieve a user by their unique identifier.

Authenticatable|null retrieveByToken(mixed $identifier, string $token)

Retrieve a user by their unique identifier and "remember me" token.

void updateRememberToken(Authenticatable $user, string $token)

Update the "remember me" token for the given user in storage.

Authenticatable|null retrieveByCredentials(array $credentials)

Retrieve a user by the given credentials.

string|null firstCredentialKey(array $credentials)

Get the first key from the credential array.

bool validateCredentials(Authenticatable $user, array $credentials)

Validate a user against the given credentials.

Builder newModelQuery(Model|null $model = null)

Get a new query builder for the model instance.

Model createModel()

Create a new instance of the model.

Hasher getHasher()

Gets the hasher implementation.

$this setHasher(Hasher $hasher)

Sets the hasher implementation.

string getModel()

Gets the name of the Eloquent user model.

$this setModel(string $model)

Sets the name of the Eloquent user model.

Details

void __construct(Hasher $hasher, string $model)

Create a new database user provider.

Parameters

Hasher $hasher
string $model

Return Value

void

Authenticatable|null retrieveById(mixed $identifier)

Retrieve a user by their unique identifier.

Parameters

mixed $identifier

Return Value

Authenticatable|null

Authenticatable|null retrieveByToken(mixed $identifier, string $token)

Retrieve a user by their unique identifier and "remember me" token.

Parameters

mixed $identifier
string $token

Return Value

Authenticatable|null

void updateRememberToken(Authenticatable $user, string $token)

Update the "remember me" token for the given user in storage.

Parameters

Authenticatable $user
string $token

Return Value

void

Authenticatable|null retrieveByCredentials(array $credentials)

Retrieve a user by the given credentials.

Parameters

array $credentials

Return Value

Authenticatable|null

protected string|null firstCredentialKey(array $credentials)

Get the first key from the credential array.

Parameters

array $credentials

Return Value

string|null

bool validateCredentials(Authenticatable $user, array $credentials)

Validate a user against the given credentials.

Parameters

Authenticatable $user
array $credentials

Return Value

bool

protected Builder newModelQuery(Model|null $model = null)

Get a new query builder for the model instance.

Parameters

Model|null $model

Return Value

Builder

Model createModel()

Create a new instance of the model.

Return Value

Model

Hasher getHasher()

Gets the hasher implementation.

Return Value

Hasher

$this setHasher(Hasher $hasher)

Sets the hasher implementation.

Parameters

Hasher $hasher

Return Value

$this

string getModel()

Gets the name of the Eloquent user model.

Return Value

string

$this setModel(string $model)

Sets the name of the Eloquent user model.

Parameters

string $model

Return Value

$this

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.8/Illuminate/Auth/EloquentUserProvider.html