On laravel / filament site I have added plugin from https://github.com/parfaitementweb/filament-country-field
and I want use key of countries just as I use in my db in lowercase.
I try to use map as :
Country::make('country')->map(function ($countryItems) {
// dd($countryItems); // if to uncomment I see items collection
// But I got error on next :
foreach ($countryItems as $key=>$label) {
$countryItems[$key] = Str::lower($label);
}
return $countryItems;
}),
raised error :
array_keys(): Argument #1 ($array) must be of type array, Closure given
Which way is correct ?
"laravel/framework": "^10.48.14",
"filament/filament": "^3.2-stable",
"parfaitementweb/filament-country-field": "^2.1"
Thanks in advance!
1