bankRepository = $bankRepositoryEloquent; } /** * @param Request $request * * @return mixed * @throws \Prettus\Repository\Exceptions\RepositoryException */ public function handleList(Request $request) { $this->bankRepository->pushCriteria(new BankCriteria($request)); $this->bankRepository->setPresenter(BankPresenter::class); return $this->bankRepository->searchBanksByPage(); } /** * @param $id * * @return \Illuminate\Database\Eloquent\Model */ public function handleProfile($id) { $this->bankRepository->setPresenter(BankPresenter::class); return $this->bankRepository->searchBankBy($id); } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleStore($data) { $bank = $this->bankRepository->create($data); return $bank; } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleUpdate($data) { $bank = $this->bankRepository->update($data,$data['id']); return $bank; } /** * @param Request $request * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleDelete($id) { return $this->bankRepository->delete($id); } }