repository = $report; parent::__construct(); } /** * Show report's list. * * @param string $slug * * @return response */ protected function index() { $reports = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->setMetaTitle(trans('report::report.names')) ->view('report::public.report.index') ->data(compact('reports')) ->output(); } /** * 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->response->setMetaTitle($report->name . trans('report::report.name')) ->view('report::public.report.show') ->data(compact('report')) ->output(); } }