Example #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     //
     $cateId = $request->input('cateId');
     if (is_null($cateId) || $cateId == 0) {
         $cateId = 0;
         $artList = Article::orderBy('id', 'DESC')->paginate(10);
     } else {
         $artList = Article::where('cate_id', $cateId)->orderBy('id', 'DESC')->paginate(10);
     }
     return backendView('index', ['cateId' => $cateId, 'article' => $artList, "cates" => Category::all()]);
 }
Example #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     return backendView('index', ['article' => Article::orderBy('updated_at', 'DESC')->paginate(10)]);
 }