3 namespace App\Http\Controllers\Auth;
5 use App\Http\Controllers\Controller;
6 use App\Providers\RouteServiceProvider;
7 use Illuminate\Auth\Events\Verified;
8 use Illuminate\Foundation\Auth\EmailVerificationRequest;
10 class VerifyEmailController extends Controller
13 * Mark the authenticated user's email address as verified.
15 * @param \Illuminate\Foundation\Auth\EmailVerificationRequest $request
16 * @return \Illuminate\Http\RedirectResponse
18 public function __invoke(EmailVerificationRequest $request)
20 if ($request->user()->hasVerifiedEmail()) {
21 return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');
24 if ($request->user()->markEmailAsVerified()) {
25 event(new Verified($request->user()));
28 return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');