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.
28 lines
822 B
28 lines
822 B
<?php |
|
|
|
namespace App\Http\Controllers\Auth; |
|
|
|
use App\Http\Controllers\Controller; |
|
use App\Providers\RouteServiceProvider; |
|
use Illuminate\Auth\Events\Verified; |
|
use Illuminate\Foundation\Auth\EmailVerificationRequest; |
|
use Illuminate\Http\RedirectResponse; |
|
|
|
class VerifyEmailController extends Controller |
|
{ |
|
/** |
|
* Mark the authenticated user's email address as verified. |
|
*/ |
|
public function __invoke(EmailVerificationRequest $request): RedirectResponse |
|
{ |
|
if ($request->user()->hasVerifiedEmail()) { |
|
return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); |
|
} |
|
|
|
if ($request->user()->markEmailAsVerified()) { |
|
event(new Verified($request->user())); |
|
} |
|
|
|
return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); |
|
} |
|
}
|
|
|