| 1 | <?php |
| 2 | |
| 3 | namespace Illuminate\Contracts\Auth; |
| 4 | |
| 5 | interface UserProvider |
| 6 | { |
| 7 | /** |
| 8 | * Retrieve a user by their unique identifier. |
| 9 | * |
| 10 | * @param mixed $identifier |
| 11 | * @return \Illuminate\Contracts\Auth\Authenticatable|null |
| 12 | */ |
| 13 | public function retrieveById($identifier); |
| 14 | |
| 15 | /** |
| 16 | * Retrieve a user by their unique identifier and "remember me" token. |
| 17 | * |
| 18 | * @param mixed $identifier |
| 19 | * @param string $token |
| 20 | * @return \Illuminate\Contracts\Auth\Authenticatable|null |
| 21 | */ |
| 22 | public function retrieveByToken($identifier, #[\SensitiveParameter] $token); |
| 23 | |
| 24 | /** |
| 25 | * Update the "remember me" token for the given user in storage. |
| 26 | * |
| 27 | * @param \Illuminate\Contracts\Auth\Authenticatable $user |
| 28 | * @param string $token |
| 29 | * @return void |
| 30 | */ |
| 31 | public function updateRememberToken(Authenticatable $user, #[\SensitiveParameter] $token); |
| 32 | |
| 33 | /** |
| 34 | * Retrieve a user by the given credentials. |
| 35 | * |
| 36 | * @param array $credentials |
| 37 | * @return \Illuminate\Contracts\Auth\Authenticatable|null |
| 38 | */ |
| 39 | public function retrieveByCredentials(#[\SensitiveParameter] array $credentials); |
| 40 | |
| 41 | /** |
| 42 | * Validate a user against the given credentials. |
| 43 | * |
| 44 | * @param \Illuminate\Contracts\Auth\Authenticatable $user |
| 45 | * @param array $credentials |
| 46 | * @return bool |
| 47 | */ |
| 48 | public function validateCredentials(Authenticatable $user, #[\SensitiveParameter] array $credentials); |
| 49 | |
| 50 | /** |
| 51 | * Rehash the user's password if required and supported. |
| 52 | * |
| 53 | * @param \Illuminate\Contracts\Auth\Authenticatable $user |
| 54 | * @param array $credentials |
| 55 | * @param bool $force |
| 56 | * @return void |
| 57 | */ |
| 58 | public function rehashPasswordIfRequired(Authenticatable $user, #[\SensitiveParameter] array $credentials, bool $force = false); |
| 59 | } |