ModelUserProvider
final class ModelUserProvider implements UserProvider
Retrieves and validates Principals backed by the Users model. Isolates all knowledge of how users are stored and looked up, so the guard can authenticate against the Users model through the UserProvider contract without depending on it directly.
Properties
| private Hasher | $hasher | The hasher used to verify supplied passwords against stored hashes. |
Methods
Retrieves a principal by its unique identifier.
Retrieves a principal matching the given credentials, without verifying them. Looks the user up by username only; password verification is performed separately by validateCredentials().
Verifies that the supplied password matches the principal's stored hash.
Details
at line 27
__construct(Hasher $hasher)
No description
at line 37
Principal|null
retrieveById(mixed $id)
Retrieves a principal by its unique identifier.
at line 51
Principal|null
retrieveByCredentials(array $credentials)
Retrieves a principal matching the given credentials, without verifying them. Looks the user up by username only; password verification is performed separately by validateCredentials().
at line 66
bool
validateCredentials(Principal $user, array $credentials)
Verifies that the supplied password matches the principal's stored hash.