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