enentRepository = $enentRepositoryEloquent; } /** * @param Request $request * * @return mixed * @throws \Prettus\Repository\Exceptions\RepositoryException */ public function handleList(Request $request) { $this->enentRepository->pushCriteria(new EnentCriteria($request)); $this->enentRepository->setPresenter(EnentPresenter::class); return $this->enentRepository->searchEnentsByPage(); } /** * @param $id * * @return \Illuminate\Database\Eloquent\Model */ public function handleProfile($id) { $this->enentRepository->setPresenter(EnentPresenter::class); return $this->enentRepository->searchEnentBy($id); } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleStore($data) { $enent = $this->enentRepository->create($data); return $enent; } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleUpdate($data) { $enent = $this->enentRepository->update($data,$data['id']); return $enent; } /** * @param Request $request * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleDelete($id) { return $this->enentRepository->delete($id); } }