Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 1 | <?php |
| 2 | |
| 3 | namespace Illuminate\Contracts\Auth; |
| 4 | |
| 5 | interface Guard |
| 6 | { |
| 7 | /** |
| 8 | * Determine if the current user is authenticated. |
| 9 | * |
| 10 | * @return bool |
| 11 | */ |
| 12 | public function check(); |
| 13 | |
| 14 | /** |
| 15 | * Determine if the current user is a guest. |
| 16 | * |
| 17 | * @return bool |
| 18 | */ |
| 19 | public function guest(); |
| 20 | |
| 21 | /** |
| 22 | * Get the currently authenticated user. |
| 23 | * |
| 24 | * @return \Illuminate\Contracts\Auth\Authenticatable|null |
| 25 | */ |
| 26 | public function user(); |
| 27 | |
| 28 | /** |
| 29 | * Get the ID for the currently authenticated user. |
| 30 | * |
| 31 | * @return int|string|null |
| 32 | */ |
| 33 | public function id(); |
| 34 | |
| 35 | /** |
| 36 | * Validate a user's credentials. |
| 37 | * |
| 38 | * @param array $credentials |
| 39 | * @return bool |
| 40 | */ |
| 41 | public function validate(array $credentials = []); |
| 42 | |
| 43 | /** |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 44 | * Determine if the guard has a user instance. |
| 45 | * |
| 46 | * @return bool |
| 47 | */ |
| 48 | public function hasUser(); |
| 49 | |
| 50 | /** |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 51 | * Set the current user. |
| 52 | * |
| 53 | * @param \Illuminate\Contracts\Auth\Authenticatable $user |
| 54 | * @return void |
| 55 | */ |
| 56 | public function setUser(Authenticatable $user); |
| 57 | } |