public function get_slider_top() { $data['slider_top'] = Slidertop::all(); $data['phan_loai'] = '.phan-loai-13'; return View::make('admin.slider_top', $data); }
}); /*Route::get('demo',function(){ $user = User::find(1)->time; $today = date('Y/m/d'); $vip = strtotime($today) - strtotime($user); echo $user.'<br/>'; echo $today.'<br/>'; echo $vip; echo '<br/>'; echo $vip/24/3600; });*/ View::composer('template.slider_top', function ($view) { if (Cache::has('top_slider')) { $slider_top = Cache::get('slider_top'); } else { $slider_top = Cache::remember('top_slider', 60, function () { return Slidertop::all(); }); } $view->with('slider_top', $slider_top); }); View::composer('template.slider_bottom', function ($view) { if (Cache::has('bottom_slider')) { $slider_bottom = Cache::get('bottom_slider'); } else { $slider_bottom = Cache::remember('bottom_slider', 60, function () { return Sliderbottom::all(); }); } $view->with('slider_bottom', $slider_bottom); });