Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shibuyakosuke/laravel-form-extend
Laravel 7+ form wrappers for Bootstrap and bulma.
https://github.com/shibuyakosuke/laravel-form-extend
artisan bootstrap bootstrap3 bootstrap4 bulma forms laravel laravel-package
Last synced: 2 months ago
JSON representation
Laravel 7+ form wrappers for Bootstrap and bulma.
- Host: GitHub
- URL: https://github.com/shibuyakosuke/laravel-form-extend
- Owner: ShibuyaKosuke
- License: mit
- Created: 2020-09-14T04:33:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-04T10:43:10.000Z (over 1 year ago)
- Last Synced: 2024-10-15T01:03:40.477Z (2 months ago)
- Topics: artisan, bootstrap, bootstrap3, bootstrap4, bulma, forms, laravel, laravel-package
- Language: PHP
- Homepage:
- Size: 216 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-form-extend
![CircleCI](https://img.shields.io/circleci/build/github/ShibuyaKosuke/laravel-form-extend/master)
![GitHub](https://img.shields.io/github/license/ShibuyaKosuke/laravel-form-extend)Laravel 7+ form wrappers for Bootstrap and bulma.
## Support css framework
- [Bootstrap 3](https://getbootstrap.com/docs/3.4/)
- [Bootstrap 4](https://getbootstrap.com/docs/4.5/getting-started/introduction/)
- [Bulma](https://bulma.io/)## Install
```shell script
composer require shibuyakosuke/laravel-form-extend
```## Config file
Publish config file.
```shell script
php artisan vendor:publish --tag=lara-form
```## Set css framework name
Edit config/lara_form.php.
```
'default' => 'bootstrap4', // bootstrap3 or bulma
```## Supported
### Elements
| | Bootstrap 4 | Bootstrap 3 | Bulma |
|:----|:---:|:----:|:---:|
|input::text| OK | OK | OK |
|input::password| OK | OK | OK |
|input::email| OK | OK | OK |
|input::url| OK | OK | OK |
|input::search| OK | OK | OK |
|input::range| OK | OK | OK |
|input::hidden| OK | OK | OK |
|input::number| OK | OK | OK |
|input::tel| OK | OK | OK |
|input::date| OK | OK | OK |
|input::datetime| OK | OK | OK |
|input::datetimeLocal| OK | OK | OK |
|input::time| OK | OK | OK |
|input::week| OK | OK | OK |
|input::file| OK | OK | OK |
|input::color| OK | OK | OK |
|button:submit| OK | OK | OK |
|button:button| OK | OK | OK |
|select| OK | OK | OK |
|textarea| OK | OK | OK |
|checkbox| OK | OK | OK |
|checkboxes| OK | OK | OK |
|radio| OK | OK | OK |
|radios| OK | OK | OK |### Addon
| | Bootstrap 4 | Bootstrap 3 | Bulma |
|:----|:---:|:----:|:---:|
|text| OK | OK | OK |
|button| OK | OK | OK |
|icon| OK | OK | OK |## Example
### Blade
```blade
Forms
{{ LaraForm::linkCss() }}
{{ LaraForm::name() }}
{{ LaraForm::horizontal() }}
{{ LaraForm::text('text', 'text', null) }}
{{ LaraForm::password('password', 'password') }}
{{ LaraForm::tel('tel', 'tel', null) }}
{{ LaraForm::email('email', 'email', null) }}
{{ LaraForm::date('date', 'date', null) }}
{{ LaraForm::datetime('datetime', 'datetime', null) }}
{{ LaraForm::datetimeLocal('datetime-local', 'datetime-local', null) }}
{{ LaraForm::url('url', 'url') }}
{{ LaraForm::search('search', 'search') }}{{ LaraForm::number('number', 'number') }}
{{ LaraForm::time('time', 'time') }}
{{ LaraForm::file('file', 'file') }}
{{ LaraForm::range('range', 'range', 10, ['min' => 0, 'max' => 100, 'step' => 10]) }}
{{ LaraForm::select('select', 'select', [], null, ['placeholder' => '----']) }}
{{ LaraForm::textarea('textarea', 'textarea', null) }}{{ LaraForm::checkboxes('checkboxes', 'checkboxes', [1 => 'choice1', 2 => 'choice2'], []) }}
{{ LaraForm::radios('radios', 'radios', [1 => 'choice1', 2 => 'choice2'], null) }}{{ LaraForm::checkbox('check', 'check', 1) }}
{{ LaraForm::radio('radio', 'radio', 1) }}{{ LaraForm::button('Button') }}
{{ LaraForm::submit() }}{{ LaraForm::close() }}
```
### Output
```html
Forms
bootstrap4
text
password
tel
date
datetime
datetime-local
url
search
number
time
file
range
select----
textarea
checkboxeschoice1choice2
radioschoice1choice2
check
radio
Button
```
## ScreeShot
Screenshot when error.
![Bootstrap4](https://raw.githubusercontent.com/ShibuyaKosuke/laravel-form-extend/master/screenshots/screeshot-bootstrap4.png "Bootstrap4")
## Addons
```blade
{{ LaraForm::email('email', 'email', null, ['prefix' => LaraForm::addonText('E-mail')]) }}{{ LaraForm::email('email', 'email', null, ['suffix' => LaraForm::addonButton('submit')]) }}
{{ LaraForm::email('email', 'email', null, ['prefix' => LaraForm::addonIcon('fas fa-envelope')]) }}
```