blob: a2ab122718c6d383639bc012b9b5449c550f2bd9 [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3namespace Illuminate\Contracts\Auth;
4
5interface 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, $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, $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(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, array $credentials);
49}