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