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