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