DatabaseUserProvider

class DatabaseUserProvider implements UserProviderInterface (View source)

Properties

protected Connection $conn The active database connection.
protected HasherInterface $hasher The hasher implementation.
protected string $table The table containing the users.

Methods

void __construct(Connection $conn, HasherInterface $hasher, string $table)

Create a new database user provider.

UserInterface|null retrieveById(mixed $identifier)

Retrieve a user by their unique identifier.

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

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

void updateRememberToken(UserInterface $user, string $token)

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

UserInterface|null retrieveByCredentials(array $credentials)

Retrieve a user by the given credentials.

bool validateCredentials(UserInterface $user, array $credentials)

Validate a user against the given credentials.

Details

void __construct(Connection $conn, HasherInterface $hasher, string $table)

Create a new database user provider.

Parameters

Connection $conn
HasherInterface $hasher
string $table

Return Value

void

UserInterface|null retrieveById(mixed $identifier)

Retrieve a user by their unique identifier.

Parameters

mixed $identifier

Return Value

UserInterface|null

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

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

Parameters

mixed $identifier
string $token

Return Value

UserInterface|null

void updateRememberToken(UserInterface $user, string $token)

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

Parameters

UserInterface $user
string $token

Return Value

void

UserInterface|null retrieveByCredentials(array $credentials)

Retrieve a user by the given credentials.

Parameters

array $credentials

Return Value

UserInterface|null

bool validateCredentials(UserInterface $user, array $credentials)

Validate a user against the given credentials.

Parameters

UserInterface $user
array $credentials

Return Value

bool

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