public function destroy($id) { try { $this->repository->find($id); } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'Projeto não encontrado.']; } return $this->repository->delete($id); }
public function destroy($noteId) { try { $this->repository->delete($noteId); } catch (ValidatorException $e) { return response()->json(['error' => true, 'message' => $e->getMessageBag()]); } catch (ModelNotFoundException $e) { return response()->json(['error' => true, 'message1' => $e->getMessage(), 'message2' => 'Project Note ID ' . $noteId . ' nao encontrado.']); } }
/** * Delete the project task * * @param integer $id project id * @return json */ public function delete($id) { if ($this->repository->delete($id)) { return ['error' => false, 'message' => 'Task deletada com sucesso']; } return ['error' => true, 'message' => 'Não foi possível deletar a task']; }
public function delete($projectId, $id) { try { $projectFile = $this->repository->find($id); if ($this->storage->exists($projectFile->getFileName())) { $this->storage->delete($projectFile->getFileName()); } $this->repository->delete($id); return ['success' => true, "message" => 'Registro excluído com sucesso.']; } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'Registro não encontrado.', "messageDev" => $e->getMessage()]; } catch (QueryException $e) { return ['error' => true, 'message' => 'Este registro não pode ser excluído, pois existe um ou mais projetos vinculados a ele.', "messageDev" => $e->getMessage()]; } catch (\Exception $e) { return ["error" => true, "message" => 'Falha ao excluir registro.', "messageDev" => $e->getMessage()]; } }
/** * Delete the project note * * @param integer $id project id * @return json */ public function delete($id) { try { $this->repository->delete($id); return ['success' => true]; } catch (\Exception $e) { return ["error" => true, "message" => $e->getMessage()]; } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($projectId, $fileId) { return ['success' => $this->service->delete($fileId)]; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { return ['success' => $this->service->delete($id)]; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($projectId, $taskId) { return ['success' => $this->repository->delete($taskId)]; }
public function delete($id) { return $this->repository->delete($id); }
public function delete($fileId) { $model = $this->repository->skipPresenter()->find($fileId); $this->storage->delete($fileId . "." . $model->extension); return $this->repository->delete($fileId); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id, $noteId) { $this->repository->delete($noteId); }