okipa / laravel-bootstrap-components
Ready-to-use and customizable components.
Fund package maintenance!
Ko Fi
paypal.me/arthurlorent
Installs: 9 436
Dependents: 0
Suggesters: 0
Security: 0
Stars: 17
Watchers: 3
Forks: 3
Open Issues: 0
Requires
- php: ^7.4||^8.0
- ext-json: *
- illuminate/support: ^7.0||^8.0
- okipa/laravel-html-helper: ^2.0
Requires (Dev)
- nunomaduro/larastan: ^0.6
- orchestra/testbench: ^5.0||^6.0
- phpmd/phpmd: ^2.9
- squizlabs/php_codesniffer: ^3.5
- dev-master
- 5.1.2.x-dev
- 5.1.2
- 5.1.1
- 5.1.0
- 5.0.2
- 5.0.1
- 5.0.0
- 4.0.0
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.12
- 2.1.11
- 2.1.10
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.0
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.10.0
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.0
- 0.6.1
- 0.6.0
- 0.5.9
- 0.5.8
- 0.5.7
- 0.5.6
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.9
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- 0.0.9
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-add-disable-placeholder-method
- dev-adding-form-management
- dev-improve-livewire-support
This package is auto-updated.
Last update: 2022-03-30 12:03:58 UTC
README
⚠️ THIS PACKAGE HAS BEEN ABANDONED IN FAVOR OF https://github.com/Okipa/laravel-form-components. ⚠️
=> 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!
Compatibility
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 |
Upgrade guide
Usage
Just call the components you need in your views and let this package take care of the HTML generation annoying part.
Standard use case
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>
Multilingual use case
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>
Table of Contents
- Installation
- Configuration
- Translations
- Views
- API documentation
- Testing
- Changelog
- Contributing
- Credits
- Licence
Installation
- Install the package with composer:
composer require okipa/laravel-bootstrap-components
Configuration
Publish the package configuration file to customize it if necessary:
php artisan vendor:publish --tag=bootstrap-components:config
⚠️ You may have to run a composer dump-autoload
after changing a path in your configuration file.
Translations
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:
Create
Update
Validate
Back
Cancel
Remove
No 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.
Views
Publish the package views to customize them if necessary:
php artisan vendor:publish --tag=bootstrap-components:views
API documentation
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.