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