$db = xxx::paginate(5);
return view('guest')->with('key',$db);
其中倒序orderBy('id', 'desc') 怎么写里面?
下面代码感觉不对
$db = xxx::paginate(5)->orderBy('id', 'desc') ;
return view('guest')->with('key',$db);
天蓬老师2017-04-10 16:00:33
$db = xxx::latest('id')->paginate(5);//orderBy('created_at', 'desc')也可以
return view('guest',['key'=>$db]);