|
2 | 2 |
|
3 | 3 | use Illuminate\Support\Facades\Route;
|
4 | 4 | use Laravel\Fortify\Features;
|
| 5 | +use Laravel\Fortify\Http\Controllers\AuthenticatedSessionController; |
| 6 | +use Laravel\Fortify\Http\Controllers\ConfirmablePasswordController; |
| 7 | +use Laravel\Fortify\Http\Controllers\ConfirmedPasswordStatusController; |
| 8 | +use Laravel\Fortify\Http\Controllers\EmailVerificationNotificationController; |
| 9 | +use Laravel\Fortify\Http\Controllers\EmailVerificationPromptController; |
| 10 | +use Laravel\Fortify\Http\Controllers\NewPasswordController; |
| 11 | +use Laravel\Fortify\Http\Controllers\PasswordController; |
| 12 | +use Laravel\Fortify\Http\Controllers\PasswordResetLinkController; |
| 13 | +use Laravel\Fortify\Http\Controllers\ProfileInformationController; |
| 14 | +use Laravel\Fortify\Http\Controllers\RecoveryCodeController; |
| 15 | +use Laravel\Fortify\Http\Controllers\RegisteredUserController; |
| 16 | +use Laravel\Fortify\Http\Controllers\TwoFactorAuthenticatedSessionController; |
| 17 | +use Laravel\Fortify\Http\Controllers\TwoFactorAuthenticationController; |
| 18 | +use Laravel\Fortify\Http\Controllers\TwoFactorQrCodeController; |
| 19 | +use Laravel\Fortify\Http\Controllers\VerifyEmailController; |
5 | 20 |
|
6 | 21 | Route::group(['middleware' => config('fortify.middleware', ['web'])], function () {
|
7 | 22 | // Authentication...
|
8 |
| - Route::get('/login', 'AuthenticatedSessionController@create') |
9 |
| - ->middleware(['guest']) |
10 |
| - ->name('login'); |
| 23 | + Route::get('/login', [AuthenticatedSessionController::class, 'create']) |
| 24 | + ->middleware(['guest']) |
| 25 | + ->name('login'); |
11 | 26 |
|
12 | 27 | $limiter = config('fortify.limiters.login');
|
13 | 28 |
|
14 |
| - Route::post('/login', 'AuthenticatedSessionController@store') |
15 |
| - ->middleware(array_filter([ |
16 |
| - 'guest', |
17 |
| - $limiter ? 'throttle:'.$limiter : null, |
18 |
| - ])); |
| 29 | + Route::post('/login', [AuthenticatedSessionController::class, 'store']) |
| 30 | + ->middleware(array_filter([ |
| 31 | + 'guest', |
| 32 | + $limiter ? 'throttle:'.$limiter : null, |
| 33 | + ])); |
19 | 34 |
|
20 |
| - Route::get('/two-factor-challenge', 'TwoFactorAuthenticatedSessionController@create') |
21 |
| - ->middleware(['guest']) |
22 |
| - ->name('two-factor.login'); |
| 35 | + Route::get('/two-factor-challenge', [TwoFactorAuthenticatedSessionController::class, 'create']) |
| 36 | + ->middleware(['guest']) |
| 37 | + ->name('two-factor.login'); |
23 | 38 |
|
24 |
| - Route::post('/two-factor-challenge', 'TwoFactorAuthenticatedSessionController@store') |
25 |
| - ->middleware(['guest']); |
| 39 | + Route::post('/two-factor-challenge', [TwoFactorAuthenticatedSessionController::class, 'store']) |
| 40 | + ->middleware(['guest']); |
26 | 41 |
|
27 |
| - Route::post('/logout', 'AuthenticatedSessionController@destroy') |
28 |
| - ->name('logout'); |
| 42 | + Route::post('/logout', [AuthenticatedSessionController::class, 'destroy']) |
| 43 | + ->name('logout'); |
29 | 44 |
|
30 | 45 | // Password Reset...
|
31 | 46 | if (Features::enabled(Features::resetPasswords())) {
|
32 |
| - Route::get('/forgot-password', 'PasswordResetLinkController@create') |
33 |
| - ->middleware(['guest']) |
34 |
| - ->name('password.request'); |
| 47 | + Route::get('/forgot-password', [PasswordResetLinkController::class, 'create']) |
| 48 | + ->middleware(['guest']) |
| 49 | + ->name('password.request'); |
35 | 50 |
|
36 |
| - Route::post('/forgot-password', 'PasswordResetLinkController@store') |
37 |
| - ->middleware(['guest']) |
38 |
| - ->name('password.email'); |
| 51 | + Route::post('/forgot-password', [PasswordResetLinkController::class, 'store']) |
| 52 | + ->middleware(['guest']) |
| 53 | + ->name('password.email'); |
39 | 54 |
|
40 |
| - Route::get('/reset-password/{token}', 'NewPasswordController@create') |
41 |
| - ->middleware(['guest']) |
42 |
| - ->name('password.reset'); |
| 55 | + Route::get('/reset-password/{token}', [NewPasswordController::class, 'create']) |
| 56 | + ->middleware(['guest']) |
| 57 | + ->name('password.reset'); |
43 | 58 |
|
44 |
| - Route::post('/reset-password', 'NewPasswordController@store') |
45 |
| - ->middleware(['guest']) |
46 |
| - ->name('password.update'); |
| 59 | + Route::post('/reset-password', [NewPasswordController::class, 'store']) |
| 60 | + ->middleware(['guest']) |
| 61 | + ->name('password.update'); |
47 | 62 | }
|
48 | 63 |
|
49 | 64 | // Registration...
|
50 | 65 | if (Features::enabled(Features::registration())) {
|
51 |
| - Route::get('/register', 'RegisteredUserController@create') |
52 |
| - ->middleware(['guest']) |
53 |
| - ->name('register'); |
| 66 | + Route::get('/register', [RegisteredUserController::class, 'create']) |
| 67 | + ->middleware(['guest']) |
| 68 | + ->name('register'); |
54 | 69 |
|
55 |
| - Route::post('/register', 'RegisteredUserController@store') |
56 |
| - ->middleware(['guest']); |
| 70 | + Route::post('/register', [RegisteredUserController::class, 'store']) |
| 71 | + ->middleware(['guest']); |
57 | 72 | }
|
58 | 73 |
|
59 | 74 | // Email Verification...
|
60 | 75 | if (Features::enabled(Features::emailVerification())) {
|
61 |
| - Route::get('/email/verify', 'EmailVerificationPromptController') |
62 |
| - ->middleware(['auth']) |
63 |
| - ->name('verification.notice'); |
| 76 | + Route::get('/email/verify', [EmailVerificationPromptController::class, '__invoke']) |
| 77 | + ->middleware(['auth']) |
| 78 | + ->name('verification.notice'); |
64 | 79 |
|
65 |
| - Route::get('/email/verify/{id}/{hash}', 'VerifyEmailController') |
66 |
| - ->middleware(['auth', 'signed', 'throttle:6,1']) |
67 |
| - ->name('verification.verify'); |
| 80 | + Route::get('/email/verify/{id}/{hash}', [VerifyEmailController::class, '__invoke']) |
| 81 | + ->middleware(['auth', 'signed', 'throttle:6,1']) |
| 82 | + ->name('verification.verify'); |
68 | 83 |
|
69 |
| - Route::post('/email/verification-notification', 'EmailVerificationNotificationController@store') |
70 |
| - ->middleware(['auth', 'throttle:6,1']) |
71 |
| - ->name('verification.send'); |
| 84 | + Route::post('/email/verification-notification', [EmailVerificationNotificationController::class, 'store']) |
| 85 | + ->middleware(['auth', 'throttle:6,1']) |
| 86 | + ->name('verification.send'); |
72 | 87 | }
|
73 | 88 |
|
74 | 89 | // Profile Information...
|
75 | 90 | if (Features::enabled(Features::updateProfileInformation())) {
|
76 |
| - Route::put('/user/profile-information', 'ProfileInformationController@update') |
77 |
| - ->middleware(['auth']); |
| 91 | + Route::put('/user/profile-information', [ProfileInformationController::class, 'update']) |
| 92 | + ->middleware(['auth']); |
78 | 93 | }
|
79 | 94 |
|
80 | 95 | // Passwords...
|
81 | 96 | if (Features::enabled(Features::updatePasswords())) {
|
82 |
| - Route::put('/user/password', 'PasswordController@update') |
83 |
| - ->middleware(['auth']); |
| 97 | + Route::put('/user/password', [PasswordController::class, 'update']) |
| 98 | + ->middleware(['auth']); |
84 | 99 | }
|
85 | 100 |
|
86 | 101 | // Password Confirmation...
|
87 |
| - Route::get('/user/confirm-password', 'ConfirmablePasswordController@show') |
88 |
| - ->middleware(['auth']) |
89 |
| - ->name('password.confirm'); |
| 102 | + Route::get('/user/confirm-password', [ConfirmablePasswordController::class, 'show']) |
| 103 | + ->middleware(['auth']) |
| 104 | + ->name('password.confirm'); |
90 | 105 |
|
91 |
| - Route::post('/user/confirm-password', 'ConfirmablePasswordController@store') |
92 |
| - ->middleware(['auth']); |
| 106 | + Route::post('/user/confirm-password', [ConfirmablePasswordController::class, 'store']) |
| 107 | + ->middleware(['auth']); |
93 | 108 |
|
94 |
| - Route::get('/user/confirmed-password-status', 'ConfirmedPasswordStatusController@show') |
95 |
| - ->middleware(['auth']) |
96 |
| - ->name('password.confirmation'); |
| 109 | + Route::get('/user/confirmed-password-status', [ConfirmedPasswordStatusController::class, 'show']) |
| 110 | + ->middleware(['auth']) |
| 111 | + ->name('password.confirmation'); |
97 | 112 |
|
98 | 113 | // Two Factor Authentication...
|
99 | 114 | if (Features::enabled(Features::twoFactorAuthentication())) {
|
100 | 115 | $twoFactorMiddleware = Features::optionEnabled(Features::twoFactorAuthentication(), 'confirmPassword')
|
101 |
| - ? ['auth', 'password.confirm'] |
102 |
| - : ['auth']; |
| 116 | + ? ['auth', 'password.confirm'] |
| 117 | + : ['auth']; |
103 | 118 |
|
104 |
| - Route::post('/user/two-factor-authentication', 'TwoFactorAuthenticationController@store') |
105 |
| - ->middleware($twoFactorMiddleware); |
| 119 | + Route::post('/user/two-factor-authentication', [TwoFactorAuthenticationController::class, 'store']) |
| 120 | + ->middleware($twoFactorMiddleware); |
106 | 121 |
|
107 |
| - Route::delete('/user/two-factor-authentication', 'TwoFactorAuthenticationController@destroy') |
108 |
| - ->middleware($twoFactorMiddleware); |
| 122 | + Route::delete('/user/two-factor-authentication', [TwoFactorAuthenticationController::class, 'destroy']) |
| 123 | + ->middleware($twoFactorMiddleware); |
109 | 124 |
|
110 |
| - Route::get('/user/two-factor-qr-code', 'TwoFactorQrCodeController@show') |
111 |
| - ->middleware($twoFactorMiddleware); |
| 125 | + Route::get('/user/two-factor-qr-code', [TwoFactorQrCodeController::class, 'show']) |
| 126 | + ->middleware($twoFactorMiddleware); |
112 | 127 |
|
113 |
| - Route::get('/user/two-factor-recovery-codes', 'RecoveryCodeController@index') |
114 |
| - ->middleware($twoFactorMiddleware); |
| 128 | + Route::get('/user/two-factor-recovery-codes', [RecoveryCodeController::class, 'index']) |
| 129 | + ->middleware($twoFactorMiddleware); |
115 | 130 |
|
116 |
| - Route::post('/user/two-factor-recovery-codes', 'RecoveryCodeController@store') |
117 |
| - ->middleware($twoFactorMiddleware); |
| 131 | + Route::post('/user/two-factor-recovery-codes', [RecoveryCodeController::class, 'store']) |
| 132 | + ->middleware($twoFactorMiddleware); |
118 | 133 | }
|
119 | 134 | });
|
0 commit comments