当前位置: 首页>>代码示例>>PHP>>正文


PHP Task::latest方法代码示例

本文整理汇总了PHP中app\Task::latest方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::latest方法的具体用法?PHP Task::latest怎么用?PHP Task::latest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Task的用法示例。


在下文中一共展示了Task::latest方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     /* Suppression de la variable non utilisée $tasks : Resolve as false positive car variable necessaire */
     $tasks = Task::latest('updated_at')->get();
     /* Duplication de 'tasks.index' : Resolve as false positive */
     return view('tasks.index', compact('tasks'));
 }
开发者ID:benjyspider,项目名称:tasks-laravel5,代码行数:12,代码来源:TasksController.php

示例2: index

 public function index()
 {
     $userType = Auth::user()->type;
     if ($userType == "admin" || $userType == "manager") {
         $tasks = Task::latest()->get();
     } else {
         $tasks = Task::where(['taskType' => 'user', 'assignedTo' => Auth::user()->id])->get();
     }
     return view('tasks.index', compact('tasks'));
 }
开发者ID:rbmulani7009,项目名称:laravel-test,代码行数:10,代码来源:TasksController.php

示例3: dashboard

 public function dashboard()
 {
     $thisWeekDeadline = \DB::select("SELECT COUNT(0) as cnt FROM tasks WHERE completed_at IS NULL AND due_date < ?", [Carbon::now()->addWeek()])[0]->cnt;
     $assignedToYou = \DB::select("SELECT COUNT(0) as cnt \n                                FROM tasks \n                                INNER JOIN task_user ON tasks.id = task_user.task_id\n                                WHERE completed_at IS NULL\n                                AND task_user.user_id = ?", [\Auth::user()->id])[0]->cnt;
     $completedCount = \DB::select("select sum(isnull(completed_at)) as not_completed, sum(not isnull(completed_at)) as completed from tasks group by completed_at;")[0];
     /*$tasksCount = \DB::table('tasks')
               ->select('project_id', 'completed_at', \DB::raw('COUNT(0) total'))
               ->groupBy('project_id', 'completed_at')
               ->get();
       dd($tasksCount);*/
     $latest = Task::latest()->whereNull('completed_at')->with('project')->take(25)->get();
     return view('dashboard.dashboard', ['latest' => $latest, 'thisWeekDeadline' => $thisWeekDeadline, 'assignedToYou' => $assignedToYou, 'completedCount' => $completedCount, 'faker' => \Faker\Factory::create()]);
 }
开发者ID:BostjanOb,项目名称:ProTODO,代码行数:13,代码来源:ProjectController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $data['tasks'] = Task::latest('updated_at')->get();
     return view('tasks.index', $data);
 }
开发者ID:OrelienG,项目名称:tasks-laravel5,代码行数:10,代码来源:TasksController.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::latest('id')->get();
     return view('tasks.index', compact('tasks'));
 }
开发者ID:OrelienG,项目名称:Zimbabwe,代码行数:10,代码来源:TasksController.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::latest()->get();
     return $this->response(['task_list' => $this->taskTransformer->transformCollection($tasks->toArray())]);
 }
开发者ID:kdj1219,项目名称:laravel5,代码行数:10,代码来源:TaskController.php

示例7: all

 public function all()
 {
     return Task::latest()->get();
 }
开发者ID:luismec90,项目名称:laravel-todo-app-best-practices,代码行数:4,代码来源:EloquentTaskRepository.php

示例8: dashBoard

 public function dashBoard(Request $request)
 {
     $tasks = Task::latest('date')->where('userId', $request->user()->id)->get();
     //tasks sorted by date TODO give only users tasks
     return view('dashBoard', compact('tasks'));
 }
开发者ID:macewanCS,项目名称:lackingllamas,代码行数:6,代码来源:DashboardController.php

示例9: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $tasks = Task::latest()->paginate(20);
     $no = $tasks->firstItem();
     return view('tasks.index', compact('tasks', 'no'));
 }
开发者ID:premsingh4github,项目名称:modulebuilder,代码行数:11,代码来源:TasksController.php


注:本文中的app\Task::latest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。