/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { if ($this->checkProjectOwner($id) == false) { return ['msg' => 'Forbidden']; } $this->repository->delete($id); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if ($this->checkProjectPermissions($id) == false) { return ['error' => 'Acesso Negado']; } $this->repository->delete($id); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { if ($this->checkProjectOwner($id) == false) { return ['error' => 'Access Forbiden']; } return $this->repository->delete($id); }
public function delete($id) { try { $this->repository->delete($id); } catch (ModelNotFoundException $e) { return response()->json(['error' => true, 'message' => "Project id {$id} not found"]); } }
public function destroy($id) { try { return $this->repository->delete($id); } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'Projeto não encontrado']; } }
public function delete($id) { $response = $this->repository->delete($id); if ($response === true) { return ['success' => true]; } return $response; }
public function delete($id) { try { $this->repository->delete($id); return ['message' => 'Delete project success']; } catch (\PDOException $e) { return ['error' => true, 'message' => $e->getMessage()]; } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => $e->getMessage()]; } }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { try { $this->repository->delete($id); return ['status' => 'success', 'message' => 'Project removed']; } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'Project not Found']; } catch (QueryException $e) { return ['error' => true, 'message' => 'This project has related project notes']; } }
/** * @param $projectId * @return array */ public function destroy($projectId) { try { if ($this->repository->delete($projectId)) { return ['success' => true, '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($id) { $projects = $this->projectRepository->findByField('client_id', $id); foreach ($projects as $project) { $this->projectRepository->delete($project->id); } $response = $this->repository->delete($id); if ($response === true) { return ['success' => true]; } return $response; }
public function destroy($id) { if (count(self::show($id)) == 0) { return ['error' => true, 'message' => 'Nao encontrado']; } else { if (count($this->repository->with(['project'])->findWhere(['id' => $id])) > 0) { return ['error' => true, 'message' => 'Este Cliente tem Projetos']; } else { return $this->repository->delete($id); } } }
public function delete($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) { if ($this->service->checkProjectPermissions($id) == false) { return ['error' => 'Access Forbidden']; } //$this->repository->find($id)->delete(); $this->repository->delete($id); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if ($this->checkProjectOwner($id) == false) { return ['error' => 'Access forbidden']; } return ['success' => $this->repository->delete($id)]; //['success' => Client::find($id)->delete()]; }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { //Client::find($id)->delete(); if ($this->checkProjectOwner($id) == false) { return ['error' => 'Access Forbidden']; } $this->repository->delete($id); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if ($this->checkProjectPermissions($id) == false) { return ['error' => 'Access Forbidden']; } if ($this->repository->delete($id)) { return ['success' => true]; } }
public function destroy($id) { try { $this->repository->delete($id); #acento aqui funcionou normal return "Projeto id:{$id} deletado com sucesso"; } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'O Projeto que está tentando deletar não existe']; } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if ($this->service->checkProjectPermissions($id) == false) { return ['error' => 'Access Forbidden']; } $result = $this->repository->delete($id); if ($result) { return ['error' => 0]; } return ['error' => 1, 'msg' => 'Erro ao tentar deletar o Project']; }
public function delete($id) { try { $this->repository->delete($id); 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 = "Projeto {$id} removido 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 }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { //return $this->repository->delete($id); try { if ($this->checkProjectOwner($id) == false) { return ['error' => 'Access forbidden']; } if ($this->repository->delete($id)) { return ['success' => true, 'message' => 'Projeto apagado com sucesso']; } } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'Não foi possível apagar o projeto! Projeto não encontrado!']; } }
public function delete($id) { $entity = Project::find($id); if (is_null($entity)) { return Errors::invalidId($id); } foreach ($entity->tasks as $task) { $this->projectTaskService->delete($task->id); } foreach ($entity->memberAssociations as $pm) { $this->projectMemberService->delete($pm->id); } $this->repository->delete($id); return ['message' => "Registro deletado!"]; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $project = $this->repository->find($id); if ($project) { $files = $this->repository->skipPresenter()->find($id)->files; foreach ($files as $file) { $this->fileService->delete($id, $file->id); } if ($this->repository->delete($id)) { return ['success' => true]; } else { return ['success' => false]; } } else { return ['success' => false, 'msg' => "Project not found!"]; } }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { //Client::find($id)->delete(); $this->repository->delete($id); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $this->repository->delete($id); }