public function update(array $data, $id) { try { $this->validator->with($data)->passesOrFail(); } catch (ValidatorException $e) { return ['error' => true, 'message' => $e->getMessageBag()]; } return $this->repository->skipPresenter()->update($data, $id); }
/** * @param $id int * @return Response */ public function destroy($id) { try { return $this->repository->skipPresenter()->find($id)->delete(); return ['status' => true, 'message' => 'Projeto excluído com sucesso']; } catch (\PDOException $e) { return ['status' => false, 'message' => 'Não foi possível excluir o cliente']; } }