Mercurial > borealpoint
comparison app/Http/Controllers/Auth/VerifyEmailController.php @ 0:9d7dcd54c677
Initial Commit and package setup
| author | luka |
|---|---|
| date | Sat, 23 Aug 2025 22:20:51 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:9d7dcd54c677 |
|---|---|
| 1 <?php | |
| 2 | |
| 3 namespace App\Http\Controllers\Auth; | |
| 4 | |
| 5 use App\Http\Controllers\Controller; | |
| 6 use Illuminate\Auth\Events\Verified; | |
| 7 use Illuminate\Foundation\Auth\EmailVerificationRequest; | |
| 8 use Illuminate\Http\RedirectResponse; | |
| 9 | |
| 10 class VerifyEmailController extends Controller | |
| 11 { | |
| 12 /** | |
| 13 * Mark the authenticated user's email address as verified. | |
| 14 */ | |
| 15 public function __invoke(EmailVerificationRequest $request): RedirectResponse | |
| 16 { | |
| 17 if ($request->user()->hasVerifiedEmail()) { | |
| 18 return redirect()->intended(route('dashboard', absolute: false).'?verified=1'); | |
| 19 } | |
| 20 | |
| 21 if ($request->user()->markEmailAsVerified()) { | |
| 22 event(new Verified($request->user())); | |
| 23 } | |
| 24 | |
| 25 return redirect()->intended(route('dashboard', absolute: false).'?verified=1'); | |
| 26 } | |
| 27 } |
