| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Illuminate\Support\Facades;
|
|
|
4 |
|
|
|
5 |
use Laravel\Ui\UiServiceProvider;
|
|
|
6 |
use RuntimeException;
|
|
|
7 |
|
|
|
8 |
/**
|
|
|
9 |
* @method static \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard guard(string|null $name = null)
|
|
|
10 |
* @method static \Illuminate\Auth\SessionGuard createSessionDriver(string $name, array $config)
|
|
|
11 |
* @method static \Illuminate\Auth\TokenGuard createTokenDriver(string $name, array $config)
|
|
|
12 |
* @method static string getDefaultDriver()
|
|
|
13 |
* @method static void shouldUse(string $name)
|
|
|
14 |
* @method static void setDefaultDriver(string $name)
|
|
|
15 |
* @method static \Illuminate\Auth\AuthManager viaRequest(string $driver, callable $callback)
|
|
|
16 |
* @method static \Closure userResolver()
|
|
|
17 |
* @method static \Illuminate\Auth\AuthManager resolveUsersUsing(\Closure $userResolver)
|
|
|
18 |
* @method static \Illuminate\Auth\AuthManager extend(string $driver, \Closure $callback)
|
|
|
19 |
* @method static \Illuminate\Auth\AuthManager provider(string $name, \Closure $callback)
|
|
|
20 |
* @method static bool hasResolvedGuards()
|
|
|
21 |
* @method static \Illuminate\Auth\AuthManager forgetGuards()
|
|
|
22 |
* @method static \Illuminate\Auth\AuthManager setApplication(\Illuminate\Contracts\Foundation\Application $app)
|
|
|
23 |
* @method static \Illuminate\Contracts\Auth\UserProvider|null createUserProvider(string|null $provider = null)
|
|
|
24 |
* @method static string getDefaultUserProvider()
|
|
|
25 |
* @method static bool check()
|
|
|
26 |
* @method static bool guest()
|
|
|
27 |
* @method static \Illuminate\Contracts\Auth\Authenticatable|null user()
|
|
|
28 |
* @method static int|string|null id()
|
|
|
29 |
* @method static bool validate(array $credentials = [])
|
|
|
30 |
* @method static bool hasUser()
|
|
|
31 |
* @method static void setUser(\Illuminate\Contracts\Auth\Authenticatable $user)
|
|
|
32 |
* @method static bool attempt(array $credentials = [], bool $remember = false)
|
|
|
33 |
* @method static bool once(array $credentials = [])
|
|
|
34 |
* @method static void login(\Illuminate\Contracts\Auth\Authenticatable $user, bool $remember = false)
|
|
|
35 |
* @method static \Illuminate\Contracts\Auth\Authenticatable|bool loginUsingId(mixed $id, bool $remember = false)
|
|
|
36 |
* @method static \Illuminate\Contracts\Auth\Authenticatable|bool onceUsingId(mixed $id)
|
|
|
37 |
* @method static bool viaRemember()
|
|
|
38 |
* @method static void logout()
|
|
|
39 |
* @method static \Symfony\Component\HttpFoundation\Response|null basic(string $field = 'email', array $extraConditions = [])
|
|
|
40 |
* @method static \Symfony\Component\HttpFoundation\Response|null onceBasic(string $field = 'email', array $extraConditions = [])
|
|
|
41 |
* @method static bool attemptWhen(array $credentials = [], array|callable|null $callbacks = null, bool $remember = false)
|
|
|
42 |
* @method static void logoutCurrentDevice()
|
|
|
43 |
* @method static \Illuminate\Contracts\Auth\Authenticatable|null logoutOtherDevices(string $password, string $attribute = 'password')
|
|
|
44 |
* @method static void attempting(mixed $callback)
|
|
|
45 |
* @method static \Illuminate\Contracts\Auth\Authenticatable getLastAttempted()
|
|
|
46 |
* @method static string getName()
|
|
|
47 |
* @method static string getRecallerName()
|
|
|
48 |
* @method static \Illuminate\Auth\SessionGuard setRememberDuration(int $minutes)
|
|
|
49 |
* @method static \Illuminate\Contracts\Cookie\QueueingFactory getCookieJar()
|
|
|
50 |
* @method static void setCookieJar(\Illuminate\Contracts\Cookie\QueueingFactory $cookie)
|
|
|
51 |
* @method static \Illuminate\Contracts\Events\Dispatcher getDispatcher()
|
|
|
52 |
* @method static void setDispatcher(\Illuminate\Contracts\Events\Dispatcher $events)
|
|
|
53 |
* @method static \Illuminate\Contracts\Session\Session getSession()
|
|
|
54 |
* @method static \Illuminate\Contracts\Auth\Authenticatable|null getUser()
|
|
|
55 |
* @method static \Symfony\Component\HttpFoundation\Request getRequest()
|
|
|
56 |
* @method static \Illuminate\Auth\SessionGuard setRequest(\Symfony\Component\HttpFoundation\Request $request)
|
|
|
57 |
* @method static \Illuminate\Support\Timebox getTimebox()
|
|
|
58 |
* @method static \Illuminate\Contracts\Auth\Authenticatable authenticate()
|
|
|
59 |
* @method static \Illuminate\Auth\SessionGuard forgetUser()
|
|
|
60 |
* @method static \Illuminate\Contracts\Auth\UserProvider getProvider()
|
|
|
61 |
* @method static void setProvider(\Illuminate\Contracts\Auth\UserProvider $provider)
|
|
|
62 |
* @method static void macro(string $name, object|callable $macro)
|
|
|
63 |
* @method static void mixin(object $mixin, bool $replace = true)
|
|
|
64 |
* @method static bool hasMacro(string $name)
|
|
|
65 |
* @method static void flushMacros()
|
|
|
66 |
*
|
|
|
67 |
* @see \Illuminate\Auth\AuthManager
|
|
|
68 |
* @see \Illuminate\Auth\SessionGuard
|
|
|
69 |
*/
|
|
|
70 |
class Auth extends Facade
|
|
|
71 |
{
|
|
|
72 |
/**
|
|
|
73 |
* Get the registered name of the component.
|
|
|
74 |
*
|
|
|
75 |
* @return string
|
|
|
76 |
*/
|
|
|
77 |
protected static function getFacadeAccessor()
|
|
|
78 |
{
|
|
|
79 |
return 'auth';
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
/**
|
|
|
83 |
* Register the typical authentication routes for an application.
|
|
|
84 |
*
|
|
|
85 |
* @param array $options
|
|
|
86 |
* @return void
|
|
|
87 |
*
|
|
|
88 |
* @throws \RuntimeException
|
|
|
89 |
*/
|
|
|
90 |
public static function routes(array $options = [])
|
|
|
91 |
{
|
|
|
92 |
if (! static::$app->providerIsLoaded(UiServiceProvider::class)) {
|
|
|
93 |
throw new RuntimeException('In order to use the Auth::routes() method, please install the laravel/ui package.');
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
static::$app->make('router')->auth($options);
|
|
|
97 |
}
|
|
|
98 |
}
|