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