Skip to content

Commit

Permalink
close #2718 #2709 Fixed Country field edit selected value issue..
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Nov 3, 2022
1 parent 2b8dcf4 commit daa76f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/View/Components/Form/Group/Country.php
Expand Up @@ -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');
}
}
2 changes: 1 addition & 1 deletion resources/views/components/form/group/country.blade.php
Expand Up @@ -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"
Expand Down

0 comments on commit daa76f2

Please sign in to comment.