Skip to content

Instantly share code, notes, and snippets.

@thannaske
Last active May 19, 2018 09:25
Show Gist options
  • Save thannaske/b0deec573ecd6ee2fded914dee5c5058 to your computer and use it in GitHub Desktop.
Save thannaske/b0deec573ecd6ee2fded914dee5c5058 to your computer and use it in GitHub Desktop.
<?php
// [...]
/**
* Perform the confirmation of the user's e-mail address.
*
* @param User $user The provided user instance
* @param $token string The provided confirmation token
* @return mixed
*/
public function confirm(User $user, $token) {
if ($user->confirm($token)) {
$message = 'You successfully confirmed your e-mail address.';
} else {
$message = 'Your e-mail address is either already confirmed or your confirmation token is wrong.';
}
return redirect()->route('login')->withMessage($message);
}
// [...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment