本文整理汇总了PHP中Task::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::destroy方法的具体用法?PHP Task::destroy怎么用?PHP Task::destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::destroy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recycleBin
public function recycleBin($task)
{
//put the task into the recycle bin
if (Auth::check()) {
$id = $task;
Task::destroy($id);
if (Auth::user()->admin == 'true') {
$deletedTasks = Task::onlyTrashed()->paginate(5);
return Redirect::Route('tasks.index', ['deletedTasks' => $deletedTasks]);
}
}
return Redirect::route('tasks.index');
}
示例2: destroy
/**
* Remove the specified resource from storage.
* DELETE /tasks/{id}
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
$status = Task::destroy($id);
return $status ? ['status' => true] : ['status' => false];
}
示例3: destroy
public static function destroy($id)
{
self::check_logged_in();
$task = new Task(array('id' => $id));
$projects = Task::getMemberOfProjects($id);
$task->destroy();
foreach ($projects as $project) {
Project::updateCount($project);
}
Redirect::to('/task', array('message' => 'Task removed successfully'));
}
示例4: delete
public function delete($id)
{
Task::destroy($id);
return redirect('tasks/index');
}
示例5: killtask
public function killtask()
{
$Task = new Task($_REQUEST['id']);
$Task->destroy();
$this->FOGCore->redirect('?node=' . $this->node);
}
示例6: destroy
public static function destroy($id)
{
parent::check_logged_in();
Task::destroy($id);
Redirect::to('/task', array('message' => 'Task has been removed.'));
}