public function home() { $link_pages = OnlineOrder::orderBy('id', 'ASC')->get(); $slider_pages = Slider::orderBy('position', 'ASC')->get(); $menu_sliders = Menu::orderBy('id', 'ASC')->get(); $menu_pdf = Menupdf::orderBy('id', 'ASC')->get(); return View::make('pages.index', ['slider_pages' => $slider_pages, 'link_pages' => $link_pages, 'menu_sliders' => $menu_sliders, 'menu_pdf' => $menu_pdf]); }
public function __construct() { $this->data['messages'] = View::make('block.messages')->with('messages', $this->getMessage())->render(); $this->data['setting'] = Setting::first(); $this->data['sliderList'] = Slider::orderBy('sort')->get(); $this->data['socialList'] = Social::orderBy('sort')->get(); $this->data['categoryList'] = Category::where('main', 0)->orderBy('sort')->get(); $this->data['groupList'] = Group::orderBy('sort')->get(); $this->data['buildOwn'] = Product::where('is_build', 1)->first(); $placeList = Place::all(); foreach ($placeList as $place) { $this->data['place'][$place->name] = $place->pageList()->orderBy('sort')->get(); } $this->data['seo'] = array('keywords' => 'Pepperino', 'title' => 'Pepperino', 'description' => 'Pepperino'); }
public function index() { //get imageslider $sliders = Slider::orderBy('created_at', 'desc')->take(5)->get(); //affiche le post vedette sur la home page avec la categorie prédéfinis $headliner = Category::with(['posts' => function ($query) { $query->orderBy('published_at', 'DESC')->take(1)->get(); }])->where('id', '=', '5')->get(); //show 4 categories with only one post by Category $categories = Category::with(['posts' => function ($query) { $query->orderBy('published_at', 'DESC')->take(5)->get(); }])->take(4)->get(); //Category publicite show image with publicity link $pub = Category::orderBy('created_at', 'DESC')->where('id', '=', '6')->take(1)->get(); //affichage des commentaires par posts $comments = Comment::orderBy('created_at', 'desc')->take(6)->get(); //Retrun 2 post by category check model Category twicePost $postCat = Category::with(['posts' => function ($query) { // Note that you don't have to call get() here! $query->orderBy('published_at', 'desc')->latest(); }])->take(4)->get(); return View::make('home.index')->with(array('sliders' => $sliders, 'comments' => $comments, 'categories' => $categories, 'headliner' => $headliner, 'pub' => $pub, 'postCat' => $postCat)); }
/** * List all the slides * @return \Illuminate\View\View */ public function index() { $slider_pages = Slider::orderBy('position')->get(); $total_pages = Slider::all()->count(); return View::make('admin.home_slider.index', array('slider_pages' => $slider_pages, 'total' => $total_pages)); }
public function slider() { $slides = Slider::orderBy('pos')->get(); return View::make('private.pages.slider')->with('slides', $slides); }
/** * * @param $id int * @return nothing * @author Tremor */ public function slider($id = 0) { $this->data['active'] = __FUNCTION__; if (isset($id) && !empty($id) && is_numeric($id)) { $this->data['slider'] = Slider::find($id); return View::make('admin.slider.one')->with($this->data); } else { $this->data['sliderList'] = Slider::orderBy('sort', 'asc')->get(); return View::make('admin.slider.list')->with($this->data); } }