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: 2.1.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.

Text input



{!! Form::bsText([
  'id' => 'text1', //field name and id
  'labeltext' => 'Text 1' // field label
]); !!}
{!! Form::bsText([
  'id' => 'text2',
  'labeltext' => 'Text 2',
  'required' => true // mandatory field
]); !!}
{!! Form::bsNumber([
  'id' => 'number',
  'labeltext' => 'Number',
  'required' => true
]); !!}
{!! Form::bsNumber([
  'id' => 'number2',
  'labeltext' => 'Number 2',
  'value'=> 5, // init value
  'attributes' => ['min' => 0, 'max' => 10], // array of additional field attributes
  'helptext' => 'Please enter a number between 0 and 10', // help text displayed below field
  'required' => true
]); !!}

Output:
<div class="mb-3" id="fg-text1">
<label for="text1" class="form-label">Text 1</label>
<input id="text1" class="form-control resettext" name="text1" type="text">
</div>

<div class="mb-3" id="fg-text2">
<label for="text2" class="form-label">Text 2</label>
<input id="text2" class="form-control verify resettext" name="text2" type="text">
<div class="invalid-feedback">This field is required</div>
</div>

<div class="mb-3" id="fg-number">
<label for="number" class="form-label">Number</label>
<input id="number" class="form-control verify resettext" name="number" type="number">
<div class="invalid-feedback">A number is required</div>
</div>

<div class="mb-3" id="fg-number2">
<label for="number2" class="form-label">Number 2</label>
<input id="number2" class="form-control verify resettext" min="0" max="10" placeholder="5" name="number2" type="number" value="5">
<div class="invalid-feedback">A number is required</div>
<p class="help-block">Please enter a number between 0 and 10</p>
</div>



This field is required
A number is required
A number is required

Please enter a number between 0 and 10



Results