public function destroy($id, $noteId) { if (count(self::show($id, $noteId)) == 0) { return ['error' => true, 'message' => 'Nao encontrado']; } else { $this->repository->delete($noteId); return ['error' => true, 'message' => 'Nota ' . $noteId . ' do Projeto Excluido']; } }
public function destroy($note_id) { try { $this->repository->delete($note_id); #acento aqui funcionou normal return "Nota id:{$note_id} deletado com sucesso"; } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'A nota que está tentando deletar não existe']; } }
public function destroy($noteId) { try { if ($this->repository->delete($noteId)) { return ['success', 'message' => 'Registro excluído']; } return ['error' => true, 'message' => 'Erro desconhecido ao tentar excluir o registro']; } catch (\Exception $e) { return ["error" => true, "message" => $e->getMessage()]; } }
public function delete($projectId, $id) { try { $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()]; } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id, $noteId) { $this->repository->delete($noteId); /* $projectNote = $this->repository->skipPresenter()->find($id); //$result = $this->repository->delete($id); $projectId = $projectNote->project_id; if($this->checkProjectNotePermissions($projectId) == false){ return ['error' => 'Access Forbidden']; } $result = $projectNote->delete(); if($result) return ['error' => 0]; return ['error' => 1, 'msg' => 'Erro ao tentar deletar a Task Note']; /* $result = $this->repository->find($id)->delete(); if($result) return ['error' => 0]; return ['error' => 1, 'msg' => 'Erro ao tentar deletar o Projecte']; */ }
/** * @param $projectId * @param $noteId */ public function delete($noteId) { try { return $this->repository->delete($noteId) ? 'Deletado' : 'Não foi possível deletar'; //findWhere(['project_id' => $projectId, 'id' => $noteId])->delete() ? 'Deletado' : 'Não foi possível deletar'; } catch (\Exception $e) { return ['error' => true, 'message' => 'An error ocurred on delete note ']; } }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id, $noteId) { try { if ($this->repository->delete($noteId)) { return ['success' => true, 'message' => 'Nota apagado com sucesso!']; } } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'Não foi possível apagar a nota! Projeto ou nota não encontrado!']; } }
public function delete($id, $noteId) { try { $this->repository->delete($noteId); return ['success' => true]; } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'No data found.']; } catch (\Exception $e) { return ['error' => true, 'message' => 'An error occurred when trying to delete the data. Try again later.']; } }
/** * @param $id * @return \Illuminate\Http\JsonResponse */ public function destroy($id) { try { $this->repository->delete($id); $msg = "Nota {$id} removida com sucesso."; Log::info($msg); return response()->json([$msg], 200); } catch (ModelNotFoundException $e) { return response()->json([$e->getMessage()], 404); } //QueryException tratado em Exceptions/Handler.php }
public function delete($note_id) { $note = ProjectNote::find($note_id); if (is_null($note)) { return Errors::invalidId($note_id); } $user_id = \Authorizer::getResourceOwnerId(); if (!$this->projectRepository->isMember($note->project_id, $user_id)) { return Errors::basic('Acesso negado. Você não é membro do projeto desta nota.'); } $this->repository->delete($note_id); return ['message' => "Registro deletado!"]; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id, $noteId) { $this->repository->delete($noteId); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { return ['success' => $this->repository->delete($id)]; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if ($this->repository->delete($id)) { return ['success' => true]; } }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($noteId) { return $this->repository->delete($noteId); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id, $noteId) { return ['success' => $this->repository->delete($noteId)]; //['success' => Client::find($id)->delete()]; }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id, $noteId) { //Client::find($id)->delete(); $this->repository->delete($noteId); }