示例#1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($slug)
 {
     $article = Article::where('slug', $slug)->firstOrFail();
     $articleSide = DB::select("select title, slug, image_lead\n                                   from articles\n                                   WHERE ID !='{$article->id}' limit 5;");
     $googlePhrahes = Google::limit(30)->orderBy('id', 'DESC')->get();
     return view('article', compact('article', 'articleSide', 'googlePhrahes'));
 }
示例#2
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'));
 }