auth.php 2.3 KB

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