repository = $demo; parent::__construct(); } /** * Show demo's list. * * @param string $slug * * @return response */ protected function index() { $demos = $this->repository->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->theme->of('demorequest::public.demo.index', compact('demos'))->render(); } /** * 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->theme->of('demorequest::public.demo.show', compact('demo'))->render(); } }