areaRepository = $areaRepositoryEloquent; } /** * @param Request $request * * @return mixed * @throws \Prettus\Repository\Exceptions\RepositoryException */ public function handleList(Request $request) { $this->areaRepository->pushCriteria(new AreaCriteria($request)); $this->areaRepository->setPresenter(AreaPresenter::class); return $this->areaRepository->searchAreasByPage(); } /** * @param $id * * @return \Illuminate\Database\Eloquent\Model */ public function handleProfile($id) { $this->areaRepository->setPresenter(AreaPresenter::class); return $this->areaRepository->searchAreaBy($id); } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleStore($data) { $area = $this->areaRepository->create($data); return $area; } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleUpdate($data) { $area = $this->areaRepository->update($data,$data['id']); return $area; } /** * @param Request $request * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleDelete($id) { return $this->areaRepository->delete($id); } }