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