Current value won't populate when editing
DODMax opened this issue · 1 comments
DODMax commented
What happened?
When using the field in an Edit form:
- Selecting a value in the dropdown will correctly save the country code in the DB
- After refreshing the page, the country field is back to "Select an option" while other fields correctly show value from DB
- Same happen on View page
How to reproduce the bug
in App\Filament\Resources\MyResource:
use Parfaitementweb\FilamentCountryField\Forms\Components\Country;
//
public static function form(Form $form): Form
{
return $form
->schema([
Country::make('Nationality')->searchable()->required(),
]);
}
Package Version
2.1.0
PHP Version
8.2.18
Laravel Version
10.45.1
Which operating systems does with happen with?
Windows
Notes
No response
DODMax commented
OK I solved my own issue, the field name should be lowercased
Country::make('**n**ationality')->searchable()->required(),