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