Exemple #1
0
 public function delete_slider_bottom()
 {
     $slider_top = Sliderbottom::find(Input::get('id'));
     $slider_top->delete();
     File::delete(Input::get('img'));
     return Redirect::to(Input::get('url_full'))->with('delete_success', 'Xóa slider-top thành công');
 }
Exemple #2
0
});
/*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);
});