FormsBootstrap

A Laravel library to generate forms based on Laravel Collective Forms & HTML, Boostrap 5 CSS Framework, RichText editor, and Icons provided by FontAwesome. Current version: 1.0.7. Project on GitHub. Project on Packagist. Manages also results inputs of packages DateRangePickerHelper, Uploader, and Tags input. Includes form management and validation. This demosite sources available here.

Select



{!! Form::bsSelect([
  'name' => 'priority', // name returned to form
  'labeltext' => 'Priority',
  'values' => ['lowest' => 'Lowest','low' => 'Low', 'medium' => 'Medium','high' => 'High','highest' => 'Highest'], //values
  'default' => 'medium' // key of default value
]) !!}
{!! Form::bsSelect([
  'name' => 'os',
  'labeltext' => 'Operating system',
  'values' => ['mac' => 'MacOs','windows' => 'Windows', 'linux' => 'Linux', 'vms' => 'Vms','unix' => 'Unix'],
  'default' => 'linux',
  'multiple' => true // multiple values field
  'required' => true
]) !!}

Output:
<div class="mb-3" id="fg-priority">
<label for="priority" class="form-label">Priority</label>
<select class="form-select resetselect" id="priority" name="priority"><option value="lowest">Lowest</option><option value="low">Low</option><option value="medium" selected="selected">Medium</option><option value="high">High</option><option value="highest">Highest</option></select>
<div class="invalid-feedback">This field is required</div>
</div>
<div class="mb-3" id="fg-os">
<label for="os" class="form-label">Operating system</label>
<select class="form-select verify resetselect" multiple="multiple" id="os" name="os[]"><option value="mac">MacOs</option><option value="windows">Windows</option><option value="linux" selected="selected">Linux</option><option value="vms">Vms</option><option value="unix">Unix</option></select>
<div class="invalid-feedback">This field is required</div>
</div>



This field is required
This field is required


Results