repository = $claim; parent::__construct(); } /** * Show claim's list. * * @param string $slug * * @return response */ protected function index() { $claims = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->setMetaTitle(trans('claim::claim.names')) ->view('claim::public.claim.index') ->data(compact('claims')) ->output(); } /** * Show claim. * * @param string $slug * * @return response */ protected function show($slug) { $claim = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->setMetaTitle($claim->name . trans('claim::claim.name')) ->view('claim::public.claim.show') ->data(compact('claim')) ->output(); } }