class DatabaseUserProvider implements UserProvider

Methods

__construct(ConnectionInterface|ConnectionResolverInterface $connection, Hasher $hasher, string $table, string|null $connectionName = null)

Create a new database user provider.

getConnection()

Get the database connection.

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.

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

Rehash the user's password if required and supported.

Details

at line 24
__construct(ConnectionInterface|ConnectionResolverInterface $connection, Hasher $hasher, string $table, string|null $connectionName = null)

Create a new database user provider.

Cached providers should receive a resolver because a concrete pooled connection is returned to its pool when the owning coroutine ends.

Parameters

ConnectionInterface|ConnectionResolverInterface $connection
Hasher $hasher
string $table
string|null $connectionName

at line 35
protected ConnectionInterface getConnection()

Get the database connection.

Return Value

ConnectionInterface

at line 47
Authenticatable|null retrieveById(mixed $identifier)

Retrieve a user by their unique identifier.

Parameters

mixed $identifier

Return Value

Authenticatable|null

at line 57
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

at line 71
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

at line 81
Authenticatable|null retrieveByCredentials(array $credentials)

Retrieve a user by the given credentials.

Parameters

array $credentials

Return Value

Authenticatable|null

at line 119
protected GenericUser|null getGenericUser(mixed $user)

Get the generic user.

Parameters

mixed $user

Return Value

GenericUser|null

at line 131
bool validateCredentials(Authenticatable $user, array $credentials)

Validate a user against the given credentials.

Parameters

Authenticatable $user
array $credentials

Return Value

bool

at line 147
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