mohkoma / nova-multiselect-checkboxes
A Laravel Nova Multiselect Dropdown Field.
Installs: 10 904
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Language:Vue
pkg:composer/mohkoma/nova-multiselect-checkboxes
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2025-09-28 20:44:09 UTC
README
Installation
composer require mohkoma/nova-multiselect-checkboxes
Usage
use Nova\MultiselectCheckboxes\MultiselectCheckboxes; MultiselectCheckboxes::make('Options', 'FIELD_NAME') ->options($this->{FIELD_NAME}->pluck('name', 'id')) ->placeholder('Options'),
Configuration
Use the options() function to pass the options list, the function accept the options as first parameter (it must be an keyed array $this->{FIELD_NAME}->pluck('name', 'id')) and optionally the selections as a secound parameters (must be an array of ids).
Please note that if you don't pass the selections, the package will use the field default value ex: FIELD_NAME column in the exemple above.
use Nova\MultiselectCheckboxes\MultiselectCheckboxes; ->options($this->{FIELD_NAME}->pluck('name', 'id'), [23, 34, 66, 76])
You're able to set a placeholder for the field using placeholder() function.
Sometimes you might need to return the value of the unselected options, for that you can use returnUnchecked() function.
use Nova\MultiselectCheckboxes\MultiselectCheckboxes; MultiselectCheckboxes::make('Options', 'FIELD_NAME') ->options($this->{FIELD_NAME}->pluck('name', 'id')) ->placeholder('Options') ->returnUnchecked(),
License
MIT
