PasswordBroker.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace Illuminate\Contracts\Auth;
  3. use Closure;
  4. interface PasswordBroker
  5. {
  6. /**
  7. * Constant representing a successfully sent reminder.
  8. *
  9. * @var string
  10. */
  11. const RESET_LINK_SENT = 'passwords.sent';
  12. /**
  13. * Constant representing a successfully reset password.
  14. *
  15. * @var string
  16. */
  17. const PASSWORD_RESET = 'passwords.reset';
  18. /**
  19. * Constant representing the user not found response.
  20. *
  21. * @var string
  22. */
  23. const INVALID_USER = 'passwords.user';
  24. /**
  25. * Constant representing an invalid token.
  26. *
  27. * @var string
  28. */
  29. const INVALID_TOKEN = 'passwords.token';
  30. /**
  31. * Constant representing a throttled reset attempt.
  32. *
  33. * @var string
  34. */
  35. const RESET_THROTTLED = 'passwords.throttled';
  36. /**
  37. * Send a password reset link to a user.
  38. *
  39. * @param array $credentials
  40. * @param \Closure|null $callback
  41. * @return string
  42. */
  43. public function sendResetLink(array $credentials, ?Closure $callback = null);
  44. /**
  45. * Reset the password for the given token.
  46. *
  47. * @param array $credentials
  48. * @param \Closure $callback
  49. * @return mixed
  50. */
  51. public function reset(array $credentials, Closure $callback);
  52. }