repository = $banner_slider; parent::__construct(); } /** * Show banner_slider's list. * * @param string $slug * * @return response */ protected function index() { $banner_sliders = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$slider::$banner_slider.names')) ->view('$slider::public.banner_slider.index') ->data(compact('$banner_sliders')) ->output(); } /** * Show banner_slider's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $banner_sliders = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$slider::$banner_slider.names')) ->view('$slider::public.banner_slider.index') ->data(compact('$banner_sliders')) ->output(); } /** * Show banner_slider. * * @param string $slug * * @return response */ protected function show($slug) { $banner_slider = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$banner_slider->name . trans('$slider::$banner_slider.name')) ->view('$slider::public.banner_slider.show') ->data(compact('$banner_slider')) ->output(); } }