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