middleware('web'); $this->setupTheme(config('theme.themes.public.theme'), config('theme.themes.public.layout')); $this->repository = $demotable; parent::__construct(); } /** * Show demotable's list. * * @param string $slug * * @return response */ protected function index() { $demotables = $this->repository ->pushCriteria(new \Assetdocs\Demotable\Repositories\Criteria\DemotablePublicCriteria()) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->theme->of('demotable::public.demotable.index', compact('demotables'))->render(); } /** * Show demotable. * * @param string $slug * * @return response */ protected function show($slug) { $demotable = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->theme->of('demotable::public.demotable.show', compact('demotable'))->render(); } }