/** * Execute the job. * * @param CommentRepository $repository * @param UserRepository $userRepository * @return static */ public function handle(CommentRepository $repository, UserRepository $userRepository) { $user_id = $this->user_id; $status_id = $this->status_id; $body = $this->body; $comment = Comment::publish($status_id, $body); $user = $userRepository->findById($user_id); $repository->save($comment, $user); return $comment; }
/** * Execute the job. * * @param $request * @param UserRepository $repository * @return mixed */ public function handle(UserRepository $repository) { $user = $repository->findById($this->userId); $repository->unfollow($this->userIdToUnfollow, $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); }
/** * Follow a Larabook user. * * @param $command * @return mixed */ public function handle($command) { $follower = $this->repository->findById($command->follower); $this->repository->unfollow($command->userToUnfollow, $follower); return $follower; }
/** * Handle the command. * * @param object $command * @return void */ public function handle($command) { $user = $this->userRepo->findById($command->userId); $this->userRepo->follow($command->userIdToFollow, $user); return $user; }