accountRepository = $accountRepositoryEloquent; } /** * @param Request $request * * @return mixed * @throws \Prettus\Repository\Exceptions\RepositoryException */ public function handleList(Request $request) { $this->accountRepository->pushCriteria(new AccountCriteria($request)); $this->accountRepository->setPresenter(AccountPresenter::class); return $this->accountRepository->searchAccountsByPage(); } /** * @param $id * * @return \Illuminate\Database\Eloquent\Model */ public function handleProfile($id) { $this->accountRepository->setPresenter(AccountPresenter::class); return $this->accountRepository->searchAccountBy($id); } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleStore($data) { $account = $this->accountRepository->create($data); return $account; } /** * @param array $data * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleUpdate($data) { $account = $this->accountRepository->update($data,$data['id']); return $account; } /** * @param Request $request * * @return mixed * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleDelete($id) { return $this->accountRepository->delete($id); } }