public function remove(Objective $objective) { foreach ($objective->actions as $action) { foreach ($action->tasks as $task) { Task::destroy($task->id); } Action::destroy($action->id); } Objective::destroy($objective->id); return redirect('/plan'); }
public function remove(Goal $goal) { if ($goal->body == "Non-Business Plan") { return back(); } foreach ($goal->objectives as $objective) { foreach ($objective->actions as $action) { foreach ($action->tasks as $task) { Task::destroy($task->id); } Action::destroy($action->id); } Objective::destroy($objective->id); } Goal::destroy($goal->id); return redirect('/plan'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if (Task::destroy($id)) { return "Task deleted successfully."; } else { return $this->response->error('Task does not exist.', 404); } }
/** * Remove the specified resource from storage if found, * else, 404 * @param int $id * @return Response */ public function destroy($id) { try { Task::findOrFail($id); Task::destroy($id); return response('', Response::HTTP_NO_CONTENT); } catch (ModelNotFoundException $e) { return new JsonResponse(['error' => 'not found'], Response::HTTP_NOT_FOUND); } }
/** * Remove the specified resource from storage. * * @param int $id * * @return Response */ public function destroy($id) { Task::destroy($id); Session::flash('flash_message', 'Task deleted!'); return redirect('admin/task'); }
/** * Delete a task or an array of tasks * * @param array|int $ids * @return void */ public function delete($ids) { $this->task->destroy($ids); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Task::destroy($id); return response()->json(); }
/** * Clear all completed Tasks * * @return \Illuminate\Http\Response */ public function clearCompleted() { $tasks = Task::where('completed', true)->get(); foreach ($tasks as $task) { Task::destroy($task->id); } return response()->json(['message' => 'Cleared Completed Tasks']); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Task::destroy($id); return response()->json(array('success' => true)); }
/** * Remove the specified Task from storage. * * @param int $id * @return Response - JSON; status ('success') and statuscode (200) */ public function destroy($id) { Task::destroy($id); $response = ['status' => 'success', 'statuscode' => 200]; return $response; }
public function remove(Action $action) { foreach ($action->tasks as $task) { Task::destroy($task->id); } Action::destroy($action->id); return redirect('/plan'); }
public function remove(Task $task) { Task::destroy($task->id); return redirect('/plan'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($task_id) { $task = Task::destroy($task_id); return \Response::json($task); }
public function apitaskDelete($id) { Task::destroy($id); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // $task = Task::destroy($id); if ($task > 0) { $affectedRows = 1; } return $affectedRows; }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { Task::destroy($id); return ['deleted' => true]; }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { Task::destroy($id); }
/** * Remove the specified resource from storage. * * @param int $id * * @return \Illuminate\Http\Response */ public function destroy($id) { Task::destroy($id); return redirect()->back(); }