/** * @param $id * Event ID or Package ID .. settable_id */ public function edit($id) { $setting = $this->settingRepository->findById($id); $feeTypes = $this->settingRepository->feeTypes; $approvalTypes = $this->settingRepository->approvalTypes; $currentRegistrationTypes = explode(',', $setting->registration_types); $registrationTypes = $this->settingRepository->registrationTypes; $countries = $this->countryRepository->getAll()->lists('name', 'id'); $currentCountries = $setting->settingable->eventCountries->modelKeys(); $this->render('admin.settings.edit', compact('setting', 'feeTypes', 'approvalTypes', 'registrationTypes', 'currentRegistrationTypes', 'countries', 'currentCountries')); }
public function detectUserCountry() { $ip = $this->getClientIP(); if (!is_null($ip)) { $record = $this->reader->country($this->getClientIP()); $country = $record->country->isoCode; if (empty($country) || !in_array($country, $this->countryRepository->supportedCountries())) { $this->setCountry($this->countryRepository->defaultCountry); } else { $this->setCountry($country); } } }