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