/**
  * Handle the command
  *
  * @param $command
  * @return mixed
  */
 public function handle($command)
 {
     $user = $this->userRepository->create(['name' => $command->name, 'password' => $command->password, 'email' => $command->email]);
     $user->raise(new UserWasRegistered($user));
     $this->dispatchEventsFor($user);
     return $user;
 }
 /**
  * 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!');
     }
 }