Guard.php 973 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace Illuminate\Contracts\Auth;
  3. interface Guard
  4. {
  5. /**
  6. * Determine if the current user is authenticated.
  7. *
  8. * @return bool
  9. */
  10. public function check();
  11. /**
  12. * Determine if the current user is a guest.
  13. *
  14. * @return bool
  15. */
  16. public function guest();
  17. /**
  18. * Get the currently authenticated user.
  19. *
  20. * @return \Illuminate\Contracts\Auth\Authenticatable|null
  21. */
  22. public function user();
  23. /**
  24. * Get the ID for the currently authenticated user.
  25. *
  26. * @return int|string|null
  27. */
  28. public function id();
  29. /**
  30. * Validate a user's credentials.
  31. *
  32. * @param array $credentials
  33. * @return bool
  34. */
  35. public function validate(array $credentials = []);
  36. /**
  37. * Set the current user.
  38. *
  39. * @param \Illuminate\Contracts\Auth\Authenticatable $user
  40. * @return void
  41. */
  42. public function setUser(Authenticatable $user);
  43. }