categorySettingRepository = $categorySettingRepositoryEloquent; } /** * @param Request $request * * @return mixed * @throws \Prettus\Repository\Exceptions\RepositoryException */ public function handleList(Request $request) { $this->categorySettingRepository->pushCriteria(new CategorySettingCriteria($request)); $this->categorySettingRepository->setPresenter(CategorySettingPresenter::class); return $this->categorySettingRepository->searchCategorySettingsByPage(); } /** * @param $id * * @return \Illuminate\Database\Eloquent\Model */ public function handleProfile($id) { $this->categorySettingRepository->setPresenter(CategorySettingPresenter::class); return $this->categorySettingRepository->searchCategorySettingBy($id); } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleStore($data) { $categorySetting = $this->categorySettingRepository->create($data); return $categorySetting; } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleUpdate($data) { $categorySetting = $this->categorySettingRepository->update($data, $data['id']); return $categorySetting; } /** * @param Request $request * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleDelete($id) { return $this->categorySettingRepository->delete($id); } }