Esempio n. 1
0
 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');
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 4
0
 /**
  * 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);
     }
 }
Esempio n. 5
0
 /**
  * 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');
 }
Esempio n. 6
0
 /**
  * Delete a task or an array of tasks
  *
  * @param array|int $ids
  * @return void
  */
 public function delete($ids)
 {
     $this->task->destroy($ids);
 }
Esempio n. 7
0
 /**
  * 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']);
 }
Esempio n. 9
0
 /**
  * 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;
 }
Esempio n. 11
0
 public function remove(Action $action)
 {
     foreach ($action->tasks as $task) {
         Task::destroy($task->id);
     }
     Action::destroy($action->id);
     return redirect('/plan');
 }
Esempio n. 12
0
 public function remove(Task $task)
 {
     Task::destroy($task->id);
     return redirect('/plan');
 }
Esempio n. 13
0
 /**
  * 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);
 }
Esempio n. 14
0
 public function apitaskDelete($id)
 {
     Task::destroy($id);
 }
Esempio n. 15
0
 /**
  * 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];
 }
Esempio n. 17
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Task::destroy($id);
 }
Esempio n. 18
0
 /**
  * Remove the specified resource from storage.
  *
  * @param int $id
  *
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Task::destroy($id);
     return redirect()->back();
 }