auth.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. use App\Http\Controllers\Auth\AuthenticatedSessionController;
  3. use App\Http\Controllers\Auth\ConfirmablePasswordController;
  4. use App\Http\Controllers\Auth\EmailVerificationNotificationController;
  5. use App\Http\Controllers\Auth\EmailVerificationPromptController;
  6. use App\Http\Controllers\Auth\NewPasswordController;
  7. use App\Http\Controllers\Auth\PasswordResetLinkController;
  8. use App\Http\Controllers\Auth\RegisteredUserController;
  9. use App\Http\Controllers\Auth\VerifyEmailController;
  10. use Illuminate\Support\Facades\Route;
  11. Route::middleware('guest')->group(function () {
  12. Route::get('register', [RegisteredUserController::class, 'create'])
  13. ->name('register');
  14. Route::post('register', [RegisteredUserController::class, 'store']);
  15. Route::get('login', [AuthenticatedSessionController::class, 'create'])
  16. ->name('login');
  17. Route::post('login', [AuthenticatedSessionController::class, 'store']);
  18. Route::get('forgot-password', [PasswordResetLinkController::class, 'create'])
  19. ->name('password.request');
  20. Route::post('forgot-password', [PasswordResetLinkController::class, 'store'])
  21. ->name('password.email');
  22. Route::get('reset-password/{token}', [NewPasswordController::class, 'create'])
  23. ->name('password.reset');
  24. Route::post('reset-password', [NewPasswordController::class, 'store'])
  25. ->name('password.update');
  26. });
  27. Route::middleware('auth')->group(function () {
  28. Route::get('verify-email', [EmailVerificationPromptController::class, '__invoke'])
  29. ->name('verification.notice');
  30. Route::get('verify-email/{id}/{hash}', [VerifyEmailController::class, '__invoke'])
  31. ->middleware(['signed', 'throttle:6,1'])
  32. ->name('verification.verify');
  33. Route::post('email/verification-notification', [EmailVerificationNotificationController::class, 'store'])
  34. ->middleware('throttle:6,1')
  35. ->name('verification.send');
  36. Route::get('confirm-password', [ConfirmablePasswordController::class, 'show'])
  37. ->name('password.confirm');
  38. Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']);
  39. Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])
  40. ->name('logout');
  41. });