本文整理汇总了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');
}
示例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');
}
示例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);
}
}
示例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);
}
}
示例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');
}
示例6: delete
/**
* Delete a task or an array of tasks
*
* @param array|int $ids
* @return void
*/
public function delete($ids)
{
$this->task->destroy($ids);
}
示例7: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Task::destroy($id);
return response()->json();
}
示例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']);
}
示例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));
}
示例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;
}
示例11: remove
public function remove(Action $action)
{
foreach ($action->tasks as $task) {
Task::destroy($task->id);
}
Action::destroy($action->id);
return redirect('/plan');
}
示例12: remove
public function remove(Task $task)
{
Task::destroy($task->id);
return redirect('/plan');
}
示例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);
}
示例14: apitaskDelete
public function apitaskDelete($id)
{
Task::destroy($id);
}
示例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;
}