PHP code example of kluseg / laravel-bootstrap-select
1. Go to this page and download the library: Download kluseg/laravel-bootstrap-select 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/ */
kluseg / laravel-bootstrap-select example snippets
<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>