UserProvider.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace Illuminate\Contracts\Auth;
  3. interface UserProvider
  4. {
  5. /**
  6. * Retrieve a user by their unique identifier.
  7. *
  8. * @param mixed $identifier
  9. * @return \Illuminate\Contracts\Auth\Authenticatable|null
  10. */
  11. public function retrieveById($identifier);
  12. /**
  13. * Retrieve a user by their unique identifier and "remember me" token.
  14. *
  15. * @param mixed $identifier
  16. * @param string $token
  17. * @return \Illuminate\Contracts\Auth\Authenticatable|null
  18. */
  19. public function retrieveByToken($identifier, $token);
  20. /**
  21. * Update the "remember me" token for the given user in storage.
  22. *
  23. * @param \Illuminate\Contracts\Auth\Authenticatable $user
  24. * @param string $token
  25. * @return void
  26. */
  27. public function updateRememberToken(Authenticatable $user, $token);
  28. /**
  29. * Retrieve a user by the given credentials.
  30. *
  31. * @param array $credentials
  32. * @return \Illuminate\Contracts\Auth\Authenticatable|null
  33. */
  34. public function retrieveByCredentials(array $credentials);
  35. /**
  36. * Validate a user against the given credentials.
  37. *
  38. * @param \Illuminate\Contracts\Auth\Authenticatable $user
  39. * @param array $credentials
  40. * @return bool
  41. */
  42. public function validateCredentials(Authenticatable $user, array $credentials);
  43. }