A Laravel Nova custom field for key-value pairs where the key is a dropdown (select) with options set via ->options().
use NowakAdmin\SelectableKeyValue\SelectableKeyValue;
SelectableKeyValue::make('Settings')
->options([
'option1' => 'Option 1',
'option2' => 'Option 2',
])- Install the package in your Nova project:
composer require nowakadmin/selectable-key-value
- Build assets:
cd nova-components/SelectableKeyValue npm install && npm run dev
- Register the field in your Nova resource as shown above.