class DatabaseUserProvider implements UserProvider (View source)

Properties

protected ConnectionInterface $connection

The active database connection.

protected Hasher $hasher

The hasher implementation.

protected string $table

The table containing the users.

Methods

void
__construct(ConnectionInterface $connection, Hasher $hasher, string $table)

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.

getGenericUser(mixed $user)

Get the generic user.

bool
validateCredentials(Authenticatable $user, array $credentials)

Validate a user against the given credentials.

Details

void __construct(ConnectionInterface $connection, Hasher $hasher, string $table)

Create a new database user provider.

Parameters

ConnectionInterface $connection
Hasher $hasher
string $table

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 GenericUser|null getGenericUser(mixed $user)

Get the generic user.

Parameters

mixed $user

Return Value

GenericUser|null

bool validateCredentials(Authenticatable $user, array $credentials)

Validate a user against the given credentials.

Parameters

Authenticatable $user
array $credentials

Return Value

bool