How to use the array to set the select options in the filamentphp? #14336
Replies: 1 comment 1 reply
-
Forms\Components\Select::make('countries')
->options(function (): array {
$languages = config('languages'); //your config
return array_map(function ($language) {
return $language['name'];
}, $languages);
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
HamidGj
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Package
Form builder
Package Version
v3
How can we help you?
I want to create options using the following array in the language.php file located in the config folder that shows a list of countries' languages.
Beta Was this translation helpful? Give feedback.
All reactions