<?php
public function verify(Request $request, $id, $hash)
{
$user = Auth::user();
if ($id != $user->getKey() || !hash_equals($hash, sha1($user->getEmailForVerification()))) {
return Redirect::route('login')->with('error', 'Invalid verification link.');
}
if ($user->markEmailAsVerified()) {
event(new Verified($user));
}
return redirect($this->redirectTo)->with('success', 'Your email has been verified successfully.');
}
<?php
public function verify(Request $request, $id, $hash)
{
$user = Auth::user();
if ($id != $user->getKey() || !hash_equals($hash, sha1($user->getEmailForVerification()))) {
return Redirect::route('login')->with('error', 'Invalid verification link.');
}
if ($user->markEmailAsVerified()) {
event(new Verified($user));
}
return redirect($this->redirectTo)->with('success', 'Your email has been verified successfully.');
}