=> Only bug fixes will be merged. Please consider moving to the new package.
Save time and take advantage of a set of dynamical, ready-to-use and fully customizable bootstrap form components.
Found this package helpful? Please consider supporting my work!
| Laravel | PHP | Bootstrap | Package |
|---|---|---|---|
| ^7.0 | ^7.4 | ^4.0 | ^5.0 |
| ^7.0 | ^7.4 | ^4.0 | ^4.0 |
| ^7.0 | ^7.4 | ^4.0 | ^3.0 |
| ^5.8 | ^7.2 | ^4.0 | ^2.0 |
| ^5.5 | ^7.1 | ^4.0 | ^1.0 |
Just call the components you need in your views and let this package take care of the HTML generation annoying part.
Call this component in your view:
{{-- Helper style --}}
{{ inputText()->name('name') }}
{{-- Facade style --}}
{{ InputText::name('name') }}And get this HTML generated for you:
<div class="component-container form-group">
<label for="text-name">
Name
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-font"></i>
</span>
</div>
<input id="text-name"
class="component form-control"
type="text"
name="name"
value=""
placeholder="Name">
</div>
</div>Call this component in your view:
{{-- Helper style --}}
{{ inputText()->name('title')->localized(['fr', 'en']) }}
{{-- Facade style --}}
{{ InputText::name('title')->localized(['fr', 'en']) }}And get this HTML generated for you:
<div class="component-container form-group">
<label for="text-title-fr">
Title (FR)
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-font"></i>
</span>
</div>
<input id="text-title-fr"
class="component form-control"
type="text"
name="title[fr]"
value=""
placeholder="Title (FR)"
data-locale="fr">
</div>
</div>
<div class="component-container form-group">
<label for="text-title-en">
Title (EN)
</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-font"></i>
</span>
</div>
<input id="text-title-en"
class="component form-control"
type="text"
name="title[en]"
value=""
placeholder="Title (EN)"
data-locale="en">
</div>
</div>composer require okipa/laravel-bootstrap-componentsPublish the package configuration file to customize it if necessary:
php artisan vendor:publish --tag=bootstrap-components:configcomposer dump-autoload after changing a path in your configuration file.
All displayed labels or sentences are translatable.
See how to translate them on the Laravel official documentation: https://laravel.com/docs/localization#using-translation-strings-as-keys.
Here is the list of the words and sentences available for translation:
CreateUpdateValidateBackCancelRemoveNo file selected.Awaited format: Day/Month/Year.Awaited format: Hour:Minutes.Awaited format: Day/Month/Year Hour:Minutes.Your browser does not support the :tag HTML5 tag.You will also have to define each attribute you define in the ->name() method in the validation (attributes key) translation file.
Publish the package views to customize them if necessary:
php artisan vendor:publish --tag=bootstrap-components:viewscomposer testPlease see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.