class Illuminate / Auth / EloquentUserProvider
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

EloquentUserProvider

Implements

Properties

protected

$hasher Hasher

The hasher implementation.

Default: null
protected

$model string

The Eloquent user model.

Default: null
protected

$queryCallback callable|null

The callback that may modify the user retrieval queries.

Default: null

Methods

public

__construct ( Hasher $hasher , $model ) : void

Create a new database user provider.

Parameters

public

retrieveById ( $identifier ) : Authenticatable |null

Retrieve a user by their unique identifier.

Parameters

  • $identifier mixed
public

retrieveByToken ( $identifier , $token ) : Authenticatable |null

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

Parameters

  • $identifier mixed
  • $token string
public

updateRememberToken ( Authenticatable $user , $token ) : void

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

Parameters

public

retrieveByCredentials ( array $credentials ) : Authenticatable |null

Retrieve a user by the given credentials.

Parameters

  • $credentials array
public

validateCredentials ( Authenticatable $user , array $credentials ) : bool

Validate a user against the given credentials.

Parameters

protected

newModelQuery ( $model ) : Builder

Get a new query builder for the model instance.

Parameters

public

createModel ( ) : Model

Create a new instance of the model.

public

getHasher ( ) : Hasher

Gets the hasher implementation.

public

setHasher ( Hasher $hasher ) : $this

Sets the hasher implementation.

Parameters

public

getModel ( ) : string

Gets the name of the Eloquent user model.

public

setModel ( $model ) : $this

Sets the name of the Eloquent user model.

Parameters

  • $model string
public

getQueryCallback ( ) : Closure |null

Get the callback that modifies the query before retrieving users.

public

withQuery ( $queryCallback ) : $this

Sets the callback to modify the query before retrieving users.

Parameters

  • $queryCallback callable|null