Beispiel #1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $medsASC = Meds::limit(15)->offset(0)->orderBy('id', 'ASC')->get();
     $medsDESC = Meds::limit(15)->offset(0)->orderBy('id', 'DESC')->get();
     $medsRAND = Meds::limit(15)->orderByRaw("RAND()")->get();
     $googlePhrahes = Google::limit(30)->orderBy('id', 'DESC')->get();
     $articles = Article::limit(30)->orderBy('id', 'DESC')->get();
     return view('index', compact('articles', 'medsASC', 'medsDESC', 'medsRAND', 'googlePhrahes'));
 }
 public function index()
 {
     /*获取文章*/
     $articles = Article::limit(4)->get();
     return view('front.index1')->with(compact('articles'));
 }