class EloquentUserProvider implements UserProvider (View source)

Properties

protected Hasher $hasher

The hasher implementation.

protected Authenticatable&Model> $model

The Eloquent user model.

protected Builder<mixed>): mixed|null $queryCallback

The callback that may modify the user retrieval queries.

Methods

__construct(Hasher $hasher, string $model)

Create a new database user provider.

retrieveById(mixed $identifier)

Retrieve a user by their unique identifier.

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.

retrieveByCredentials(array $credentials)

Retrieve a user by the given credentials.

bool
validateCredentials(Authenticatable $user, array $credentials)

Validate a user against the given credentials.

void
rehashPasswordIfRequired(Authenticatable $user, array $credentials, bool $force = false)

Rehash the user's password if required and supported.

TModel>
newModelQuery(TModel|null $model = null)

Get a new query builder for the model instance.

createModel()

Create a new instance of the model.

getHasher()

Gets the hasher implementation.

$this
setHasher(Hasher $hasher)

Sets the hasher implementation.

Authenticatable&Model>
getModel()

Gets the name of the Eloquent user model.

$this
setModel(Model> $model)

Sets the name of the Eloquent user model.

Builder<mixed>): mixed|null
getQueryCallback()

Get the callback that modifies the query before retrieving users.

$this
withQuery(Builder<mixed>): mixed|null $queryCallback = null)

Sets the callback to modify the query before retrieving users.

Details

__construct(Hasher $hasher, string $model)

Create a new database user provider.

Parameters

Hasher $hasher
string $model

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

bool validateCredentials(Authenticatable $user, array $credentials)

Validate a user against the given credentials.

Parameters

Authenticatable $user
array $credentials

Return Value

bool

void rehashPasswordIfRequired(Authenticatable $user, array $credentials, bool $force = false)

Rehash the user's password if required and supported.

Parameters

Authenticatable $user
array $credentials
bool $force

Return Value

void

protected TModel> newModelQuery(TModel|null $model = null)

Get a new query builder for the model instance.

Parameters

TModel|null $model

Return Value

TModel>

Authenticatable&Model createModel()

Create a new instance of the model.

Return Value

Authenticatable&Model

Hasher getHasher()

Gets the hasher implementation.

Return Value

Hasher

$this setHasher(Hasher $hasher)

Sets the hasher implementation.

Parameters

Hasher $hasher

Return Value

$this

Authenticatable&Model> getModel()

Gets the name of the Eloquent user model.

Return Value

Authenticatable&Model>

$this setModel(Model> $model)

Sets the name of the Eloquent user model.

Parameters

Model> $model

Return Value

$this

Builder<mixed>): mixed|null getQueryCallback()

Get the callback that modifies the query before retrieving users.

Return Value

Builder<mixed>): mixed|null

$this withQuery(Builder<mixed>): mixed|null $queryCallback = null)

Sets the callback to modify the query before retrieving users.

Parameters

Builder<mixed>): mixed|null $queryCallback

Return Value

$this

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.