eventRepository = $eventRepositoryEloquent; } /** * @param Request $request * * @return mixed * @throws \Prettus\Repository\Exceptions\RepositoryException */ public function handleList(Request $request) { $this->eventRepository->pushCriteria(new EventCriteria($request)); $this->eventRepository->setPresenter(EventPresenter::class); return $this->eventRepository->searchEventsByPage(); } /** * @param $id * * @return \Illuminate\Database\Eloquent\Model */ public function handleProfile($id) { $this->eventRepository->setPresenter(EventPresenter::class); return $this->eventRepository->searchEventBy($id); } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleStore($data) { $event = $this->eventRepository->create($data); return $event; } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleUpdate($data) { $event = $this->eventRepository->update($data,$data['id']); return $event; } /** * @param Request $request * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleDelete($id) { return $this->eventRepository->delete($id); } }