diff --git a/app/View/Components/Form/Group/Country.php b/app/View/Components/Form/Group/Country.php index b54a86b17..76f600bda 100644 --- a/app/View/Components/Form/Group/Country.php +++ b/app/View/Components/Form/Group/Country.php @@ -15,6 +15,14 @@ class Country extends Form */ public function render() { + if (empty($this->name)) { + $this->name = 'country'; + } + + if (empty($this->selected) && empty($this->getParentData('model'))) { + $this->selected = setting('company.country'); + } + return view('components.form.group.country'); } } diff --git a/resources/views/components/form/group/country.blade.php b/resources/views/components/form/group/country.blade.php index 4b7dc4732..587be1f97 100644 --- a/resources/views/components/form/group/country.blade.php +++ b/resources/views/components/form/group/country.blade.php @@ -2,7 +2,7 @@ name="country" label="{!! trans_choice('general.countries', 1) !!}" :options="trans('countries')" - :selected="setting('company.country')" + :selected="$selected" required="{{ $required }}" not-required="{{ $notRequired }}" model="form.country"