PasswordBroker.php 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 password.
  26. *
  27. * @var string
  28. */
  29. const INVALID_PASSWORD = 'passwords.password';
  30. /**
  31. * Constant representing an invalid token.
  32. *
  33. * @var string
  34. */
  35. const INVALID_TOKEN = 'passwords.token';
  36. /**
  37. * Send a password reset link to a user.
  38. *
  39. * @param array $credentials
  40. * @return string
  41. */
  42. public function sendResetLink(array $credentials);
  43. /**
  44. * Reset the password for the given token.
  45. *
  46. * @param array $credentials
  47. * @param \Closure $callback
  48. * @return mixed
  49. */
  50. public function reset(array $credentials, Closure $callback);
  51. /**
  52. * Set a custom password validator.
  53. *
  54. * @param \Closure $callback
  55. * @return void
  56. */
  57. public function validator(Closure $callback);
  58. /**
  59. * Determine if the passwords match for the request.
  60. *
  61. * @param array $credentials
  62. * @return bool
  63. */
  64. public function validateNewPassword(array $credentials);
  65. }