blob: 2a27fb5f507eaaee014bac96d61657fc98ca8c51 [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3namespace Illuminate\Contracts\Auth;
4
5interface 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 /**
44 * Set the current user.
45 *
46 * @param \Illuminate\Contracts\Auth\Authenticatable $user
47 * @return void
48 */
49 public function setUser(Authenticatable $user);
50}