当前位置: 首页>>代码示例>>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;未经允许,请勿转载。