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