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->notes as $note) { $this->projectNoteService->delete($note->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, $noteId) { $this->service->delete($noteId); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($projectId, $id) { return $this->service->delete($projectId, $id); }
public function destroy($note_id) { return $this->service->delete($note_id); }