/** * Handle the command * * @param $command * @return mixed */ public function handle($command) { $user = User::register($command->name, $command->email, $command->password, $command->cat_one, $command->cat_two, $command->cat_three, $command->sex); $this->repository->save($user); $this->dispatchEventsFor($user); return $user; }
public function pageMe($fullname) { if (Auth::user()) { $user = $this->userRepository->findByFullname($fullname); $users = User::where('id', '!=', Auth::id())->get(); return View::make('pageme.index', compact('user', 'users')); } else { Flash::message(lang('You must be logged in to message users')); return Redirect::route('login'); } }
/** * Handle the command * * @param $command * @return mixed */ public function handle($command) { $user = $this->userRepo->findById($command->userId); $this->userRepo->follow($command->userIdToFollow, $user); return $user; }
/** * Handle the command. * * @param object $command * @return void */ public function handle($command) { $user = $this->userRepo->findById($command->userId); $this->userRepo->unfollow($command->userIdToUnfollow, $user); }