Auth.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace Illuminate\Support\Facades;
  3. use Laravel\Ui\UiServiceProvider;
  4. use RuntimeException;
  5. /**
  6. * @method static \Illuminate\Auth\AuthManager extend(string $driver, \Closure $callback)
  7. * @method static \Illuminate\Auth\AuthManager provider(string $name, \Closure $callback)
  8. * @method static \Illuminate\Contracts\Auth\Authenticatable loginUsingId(mixed $id, bool $remember = false)
  9. * @method static \Illuminate\Contracts\Auth\Authenticatable|null user()
  10. * @method static \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard guard(string|null $name = null)
  11. * @method static \Illuminate\Contracts\Auth\UserProvider|null createUserProvider(string $provider = null)
  12. * @method static \Symfony\Component\HttpFoundation\Response|null onceBasic(string $field = 'email',array $extraConditions = [])
  13. * @method static bool attempt(array $credentials = [], bool $remember = false)
  14. * @method static bool hasUser()
  15. * @method static bool check()
  16. * @method static bool guest()
  17. * @method static bool once(array $credentials = [])
  18. * @method static bool onceUsingId(mixed $id)
  19. * @method static bool validate(array $credentials = [])
  20. * @method static bool viaRemember()
  21. * @method static bool|null logoutOtherDevices(string $password, string $attribute = 'password')
  22. * @method static int|string|null id()
  23. * @method static void login(\Illuminate\Contracts\Auth\Authenticatable $user, bool $remember = false)
  24. * @method static void logout()
  25. * @method static void logoutCurrentDevice()
  26. * @method static void setUser(\Illuminate\Contracts\Auth\Authenticatable $user)
  27. * @method static void shouldUse(string $name);
  28. *
  29. * @see \Illuminate\Auth\AuthManager
  30. * @see \Illuminate\Contracts\Auth\Factory
  31. * @see \Illuminate\Contracts\Auth\Guard
  32. * @see \Illuminate\Contracts\Auth\StatefulGuard
  33. */
  34. class Auth extends Facade
  35. {
  36. /**
  37. * Get the registered name of the component.
  38. *
  39. * @return string
  40. */
  41. protected static function getFacadeAccessor()
  42. {
  43. return 'auth';
  44. }
  45. /**
  46. * Register the typical authentication routes for an application.
  47. *
  48. * @param array $options
  49. * @return void
  50. *
  51. * @throws \RuntimeException
  52. */
  53. public static function routes(array $options = [])
  54. {
  55. if (! static::$app->providerIsLoaded(UiServiceProvider::class)) {
  56. throw new RuntimeException('In order to use the Auth::routes() method, please install the laravel/ui package.');
  57. }
  58. static::$app->make('router')->auth($options);
  59. }
  60. }