You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
630 B

  1. <?php
  2. namespace App\Http\Controllers\Auth;
  3. use App\Http\Controllers\Controller;
  4. use Illuminate\Http\RedirectResponse;
  5. use Illuminate\Http\Request;
  6. class EmailVerificationNotificationController extends Controller
  7. {
  8. /**
  9. * Send a new email verification notification.
  10. */
  11. public function store(Request $request): RedirectResponse
  12. {
  13. if ($request->user()->hasVerifiedEmail()) {
  14. return redirect()->intended(route('dashboard', absolute: false));
  15. }
  16. $request->user()->sendEmailVerificationNotification();
  17. return back()->with('status', 'verification-link-sent');
  18. }
  19. }