PHP code example of marotura / nested-multiselect

1. Go to this page and download the library: Download marotura/nested-multiselect library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

marotura / nested-multiselect example snippets


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',
        ]
    ])

protected $casts = [
        'nested' => 'json',
    ];