Esempio n. 1
0
 /**
  * Created by Emad Mirzaie on 23/10/2015.
  * The shop
  */
 public function home(Shop $shop)
 {
     $shop->visit();
     $top_visit_products = $shop->products()->orderBy('num_visit', 'desc')->get()->take(4);
     $top_comment_products = $shop->products()->orderBy('num_comment', 'desc')->get()->take(4);
     $latest_products = $shop->products()->latest()->get();
     return view('shop.home', compact('shop', 'top_visit_products', 'latest_products', 'top_comment_products'))->with(['title' => $shop->title]);
 }