/**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $tasks = Tasks::orderBy("created_at", "desc")->paginate(10);
     $tasks->setPath('tasks');
     return view('tasks/index', compact('tasks'));
 }
Example #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $tasks = Tasks::orderBy('deadline')->get()->where('status', 1);
     return view('tasks.index')->withTasks($tasks);
 }