pavloniym / nova-options-selector
Multiple options selector field for Laravel Nova.
Installs: 4 001
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 1
Language:Vue
Requires
- php: >=8.0
- laravel/nova: ^4.1
README
This Laravel Nova package adds an options selector to Nova's arsenal of fields.
Requirements
php: >=8.0
laravel/nova: ^4.1
Installation
Install the package in a Laravel Nova project via Composer:
composer require pavloniym/nova-options-selector
Usage
Model field should be casted as array
use Pavloniym\OptionsSelector\OptionsSelector; public function fields(Request $request) { return [ OptionsSelector::make('Permissions', 'permissions') ->options([ [ 'group' => [ 'title' => 'Account permissions', ], 'entries' => [ [ 'key' => 'account:update', 'title' => 'Update account', 'description' => 'User can update any account in database' ], [ 'key' => 'account:selfDelete', 'title' => 'Delete self account' ], ] ], // ... ]) // Optional: ->searchable() // show search bar on form and detail views ->setGridColumnsGap(4) // set gap between columns ->setGridColumnsWidth(250) // set grid columns width in pixels ->setMaxRowWidthOnIndex('200px') // set max with on index field ]; }
License
This project is open-sourced software licensed under the MIT license.