當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Task::destroy方法代碼示例

本文整理匯總了PHP中app\Task::destroy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Task::destroy方法的具體用法?PHP Task::destroy怎麽用?PHP Task::destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Task的用法示例。


在下文中一共展示了Task::destroy方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: remove

 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');
 }
開發者ID:macewanCS,項目名稱:librasoft,代碼行數:11,代碼來源:ObjsController.php

示例2: remove

 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');
 }
開發者ID:macewanCS,項目名稱:librasoft,代碼行數:17,代碼來源:GoalsController.php

示例3: destroy

 /**
  * 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);
     }
 }
開發者ID:sax69sax,項目名稱:task-manager-api,代碼行數:14,代碼來源:TasksController.php

示例4: destroy

 /**
  * 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);
     }
 }
開發者ID:kocsenc,項目名稱:api,代碼行數:16,代碼來源:TasksController.php

示例5: destroy

 /**
  * 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');
 }
開發者ID:thibaultvanc,項目名稱:organit,代碼行數:13,代碼來源:TaskController.php

示例6: delete

 /**
  * Delete a task or an array of tasks
  *
  * @param array|int $ids
  * @return void
  */
 public function delete($ids)
 {
     $this->task->destroy($ids);
 }
開發者ID:MikeGeorgeff,項目名稱:skills-tes,代碼行數:10,代碼來源:TaskRepository.php

示例7: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Task::destroy($id);
     return response()->json();
 }
開發者ID:ronal2do,項目名稱:HybridApp,代碼行數:11,代碼來源:TaskController.php

示例8: clearCompleted

 /**
  * 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']);
 }
開發者ID:LoveAndHappiness,項目名稱:polymer-laravel-todoapp,代碼行數:13,代碼來源:TasksController.php

示例9: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Task::destroy($id);
     return response()->json(array('success' => true));
 }
開發者ID:JChacks,項目名稱:TodoList,代碼行數:11,代碼來源:TaskController.php

示例10: destroy

 /**
  * 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;
 }
開發者ID:jakoberzar,項目名稱:TODO-List-Demo,代碼行數:12,代碼來源:TasksController.php

示例11: remove

 public function remove(Action $action)
 {
     foreach ($action->tasks as $task) {
         Task::destroy($task->id);
     }
     Action::destroy($action->id);
     return redirect('/plan');
 }
開發者ID:macewanCS,項目名稱:librasoft,代碼行數:8,代碼來源:ActionsController.php

示例12: remove

 public function remove(Task $task)
 {
     Task::destroy($task->id);
     return redirect('/plan');
 }
開發者ID:macewanCS,項目名稱:librasoft,代碼行數:5,代碼來源:TasksController.php

示例13: destroy

 /**
  * 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);
 }
開發者ID:swilliamrobert,項目名稱:mall-app,代碼行數:11,代碼來源:TaskController.php

示例14: apitaskDelete

 public function apitaskDelete($id)
 {
     Task::destroy($id);
 }
開發者ID:andbet39,項目名稱:things,代碼行數:4,代碼來源:TaskController.php

示例15: destroy

 /**
  * 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;
 }
開發者ID:gitfreengers,項目名稱:larus,代碼行數:15,代碼來源:TasksController.php


注:本文中的app\Task::destroy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。