/** * Verify a user account * @param $token string A token that references the user to verify * @return \Illuminate\Http\RedirectResponse Redirects the user to the appropriate login form */ public function verify($token) { $user = $this->userRepository->getByConfirmationToken($token); if ($user->confirmed != 0) { return Redirect::route('user.login')->withErrors('You have already activated your account, please log in below.'); } else { $this->userRepository->confirmUserById($user->id); return Redirect::route('user.login')->with('message', 'You have successfully activated your account, you can now log in and play!'); } }