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