marotura/nested-multiselect

A nested multiselect field for Laravel Nova

Installs: 418

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:Vue

pkg:composer/marotura/nested-multiselect

1.0.3 2024-07-08 10:00 UTC

This package is auto-updated.

Last update: 2025-12-08 13:03:40 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',
    ];