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