kluseg/laravel-bootstrap-select

Set of selects utilizing bootstrap's 4 dropdowns paired with Laravel components

v1.0.0 2019-03-15 16:33 UTC

This package is auto-updated.

Last update: 2024-12-16 05:46:46 UTC


README

Latest Version on Packagist Total Downloads Build Status StyleCI

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require kluseg/laravel-bootstrap-select

Usage

$ php artisan vendor:publish --tag=laravel-bootstrap-select-assets

In webpack.mix.js

mix.js('resources/assets/vendor/kluseg/js/multiple-select.js', 'public/js')
   .sass('resources/assets/vendor/kluseg/sass/multiple-select.scss', 'public/css')

In your views

<div class="form-group">
    <label>I am multiple select!</label>
    @component('bs::multiple-select-sync', [
        'sm' => true,
        'model' => null,
        'items' => [
            [
                'name' => 'input_name_1',
                'value' => 'input_value_1',
                'label' => 'Label 1'
            ],
            [
                'name' => 'input_name_2',
                'value' => 'input_value_2',
                'label' => 'Label 2'
            ]
        ]
    ])
        Please select one
    @endcomponent
</div>
<div class="form-group">
    <label>I am single select!</label>
    @component('bs::multiple-select-sync', [
        'sm' => true,
        'model' => null,
        'items' => [
            [
                'group' => 'first_group',
                'label' => 'I am single select!',
                'unique' => true,
                'items' => [
                    [
                        'name' => 'input_name_1',
                        'value' => 'input_value_1',
                        'label' => 'Label 1'
                    ],
                    [
                        'name' => 'input_name_2',
                        'value' => 'input_value_2',
                        'label' => 'Label 2'
                    ]
                ]
            ],
        ]
    ])
        Please select one
    @endcomponent
</div>
<div class="form-group">
    <label>I am everything-in-one select!</label>
    @component('bs::multiple-select-sync', [
        'items' => [
            [
                'group' => 'first_group',
                'label' => 'I am unique group!',
                'unique' => true,
                'items' => [
                    [
                        'name' => 'input_name_1',
                        'value' => 'input_value_1',
                        'label' => 'Label 1'
                    ],
                    [
                        'name' => 'input_name_2',
                        'value' => 'input_value_2',
                        'label' => 'Label 2'
                    ]
                ]
            ],
            [
                'group' => 'second_group',
                'label' => 'I am not an unique group!',
                'unique' => false,
                'items' => [
                    [
                        'name' => 'input_name_1',
                        'value' => 'input_value_1',
                        'label' => 'Label 1'
                    ],
                    [
                        'name' => 'input_name_2',
                        'value' => 'input_value_2',
                        'label' => 'Label 2'
                    ]
                ]
            ],
        ]
    ])
        Please select one
    @endcomponent
</div>

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.