/** * 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 $this->service->delete($id); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if ($this->checkProjectPermissions($id) == false) { return ['error' => true, 'message' => 'Access forbidden']; } return $this->service->delete($id); }
public function delete($id) { $entity = Client::find($id); if (is_null($entity)) { return Errors::invalidId($id); } foreach ($entity->projects as $proj) { $this->projectService->delete($proj->id); } $this->repository->delete($id); return ['message' => "Registro deletado!"]; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if (!$this->checkProjectPermissions($id)) { return ['error' => 'Access forbidden']; } return $this->service->delete($id); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { //return $this->service->delete($id); try { $this->service->delete($id); return response()->json(['error' => false, 'message' => ['removeMember' => "Projeto removido{$id}"]]); } catch (ModelNotFoundException $e) { return response()->json($this->noFound($id)); } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if (!$this->checkProjectOwner($id)) { return ['error' => 'Access Forbidden!']; } $retorno = $this->service->delete($id); if ($retorno === true) { return 'Deletado'; } return $retorno; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { return $this->service->delete($id); }