marotura / nested-multiselect
A nested multiselect field for Laravel Nova
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Vue
Requires
- php: ^8.0
This package is auto-updated.
Last update: 2024-05-17 14:51:28 UTC
README
A nested multiselect field for Laravel Nova. This package makes use of vue3-treeselect
To install this package use:
composer require marotura/nested-multiselect
This field extends the Nova Multiselect field. At the moment this is the most basic implementation.
NestedMultiselect::make('Nested', 'nested') ->options([ [ 'id' => 'a', 'label' => 'a', 'children' => [ [ 'id' => 'aa', 'label' => 'aa', ], [ 'id' => 'ab', 'label' => 'ab', ], ] ], [ 'id' => 'b', 'label' => 'b', ], [ 'id' => 'c', 'label' => 'c', ] ])
Also make sure to cast your field to array of json
protected $casts = [ 'nested' => 'json', ];