本文整理汇总了PHP中app\Task::unfinished方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::unfinished方法的具体用法?PHP Task::unfinished怎么用?PHP Task::unfinished使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Task
的用法示例。
在下文中一共展示了Task::unfinished方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: home
public function home()
{
$page_title = "لوحة التحكم";
$section_title = "لوحة التحكم";
Date::setLocale('ar');
$date = Date::now()->format('j F Y');
$day = Date::now()->format('l');
$month = Date::now()->format('F');
$year = Date::now()->format('Y');
//**************Tasks***************
$tasksUnfinished = Task::unfinished();
$tasksToday = Task::orderBy('task_date', 'desc')->today()->take(5);
$tasksWeek = Task::orderBy('task_date', 'desc')->thisweek()->take(5);
$tasksMonth = Task::orderBy('task_date', 'desc')->thisMonth()->take(5);
$tasks_count = count($tasksUnfinished->toArray());
//**************Fails***************
$failsunfixed = Failure::waiting();
$failsToday = Failure::orderBy('fail_time', 'desc')->today()->take(5);
$failsWeek = Failure::orderBy('fail_time', 'desc')->thisweek()->take(5);
$failsMonth = Failure::orderBy('fail_time', 'desc')->thisMonth()->take(5);
$fails_count = count($failsunfixed->toArray());
//**************Repairs***************
$repairsBox = Repair::finished();
$repairsToday = Repair::today();
$repairsWeek = Repair::thisweek();
$repairsMonth = Repair::thisMonth();
$repairs_count = count($repairsBox);
return view('dashboard.dashboard', compact('page_title', 'section_title', 'date', 'day', 'month', 'year', 'tasksToday', 'tasksMonth', 'tasksWeek', 'tasks_count', 'failsToday', 'failsMonth', 'failsWeek', 'fails_count', 'repairsToday', 'repairsMonth', 'repairsWeek', 'repairs_count'));
}
示例2: filter
public function filter($filter)
{
if ($filter == "Completed") {
$tasks = Task::finished()->get();
return view('tasks.index', compact('tasks'));
} elseif ($filter == "Pending") {
$tasks = Task::unfinished()->get();
return view('tasks.index', compact('tasks'));
} else {
return redirect('todo');
}
}