StatefulGuard.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace Illuminate\Contracts\Auth;
  3. interface StatefulGuard extends Guard
  4. {
  5. /**
  6. * Attempt to authenticate a user using the given credentials.
  7. *
  8. * @param array $credentials
  9. * @param bool $remember
  10. * @return bool
  11. */
  12. public function attempt(array $credentials = [], $remember = false);
  13. /**
  14. * Log a user into the application without sessions or cookies.
  15. *
  16. * @param array $credentials
  17. * @return bool
  18. */
  19. public function once(array $credentials = []);
  20. /**
  21. * Log a user into the application.
  22. *
  23. * @param \Illuminate\Contracts\Auth\Authenticatable $user
  24. * @param bool $remember
  25. * @return void
  26. */
  27. public function login(Authenticatable $user, $remember = false);
  28. /**
  29. * Log the given user ID into the application.
  30. *
  31. * @param mixed $id
  32. * @param bool $remember
  33. * @return \Illuminate\Contracts\Auth\Authenticatable
  34. */
  35. public function loginUsingId($id, $remember = false);
  36. /**
  37. * Log the given user ID into the application without sessions or cookies.
  38. *
  39. * @param mixed $id
  40. * @return bool
  41. */
  42. public function onceUsingId($id);
  43. /**
  44. * Determine if the user was authenticated via "remember me" cookie.
  45. *
  46. * @return bool
  47. */
  48. public function viaRemember();
  49. /**
  50. * Log the user out of the application.
  51. *
  52. * @return void
  53. */
  54. public function logout();
  55. }