mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2024-12-29 11:01:15 +01:00
31 lines
900 B
PHP
Executable File
31 lines
900 B
PHP
Executable File
<?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;
|
|
|
|
class VerifyEmailController extends Controller
|
|
{
|
|
/**
|
|
* Mark the authenticated user's email address as verified.
|
|
*
|
|
* @param \Illuminate\Foundation\Auth\EmailVerificationRequest $request
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
*/
|
|
public function __invoke(EmailVerificationRequest $request)
|
|
{
|
|
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');
|
|
}
|
|
}
|