watchRecordRepository = $watchRecordRepositoryEloquent; } /** * @param Request $request * * @return mixed * @throws \Prettus\Repository\Exceptions\RepositoryException */ public function handleList(Request $request) { $this->watchRecordRepository->pushCriteria(new WatchRecordCriteria($request)); $this->watchRecordRepository->setPresenter(WatchRecordPresenter::class); return $this->watchRecordRepository->searchWatchRecordsByPage(); } /** * @param $id * * @return \Illuminate\Database\Eloquent\Model */ public function handleProfile($id) { $this->watchRecordRepository->setPresenter(WatchRecordPresenter::class); return $this->watchRecordRepository->searchWatchRecordBy($id); } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleStore($data) { $watchRecord = $this->watchRecordRepository->create($data); return $watchRecord; } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleUpdate($data) { $watchRecord = $this->watchRecordRepository->update($data, $data['id']); return $watchRecord; } /** * @param Request $request * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleDelete($id) { return $this->watchRecordRepository->delete($id); } }