https://github.com/vaneves/laravel-form
💠HTML Helper for Laravel Framework
https://github.com/vaneves/laravel-form
bootstrap3 laravel-form
Last synced: 2 months ago
JSON representation
💠HTML Helper for Laravel Framework
- Host: GitHub
- URL: https://github.com/vaneves/laravel-form
- Owner: vaneves
- License: unlicense
- Created: 2017-01-19T19:05:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-01T18:11:10.000Z (over 7 years ago)
- Last Synced: 2025-01-27T08:30:47.838Z (4 months ago)
- Topics: bootstrap3, laravel-form
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Form
## Installing with Composer
```
composer require vaneves/laravel-form
```### Configuration
Add the `Form` facade to the `aliases` array in `config/app.php`:
```php
'aliases' => [
//...
'Form' => Vaneves\Laravel\Form\Form::class,
]
```## Usage
### Basic
```php
{!! Form::open('register') !!}
{!! Form::text('Your name', 'name') !!}
{!! Form::email('Email', 'email') !!}
{!! Form::password('Password', 'password') !!}
{!! Form::reset('Clear')->warning() !!}
{!! Form::submit('Save')->primary() !!}
{!! Form::close() !!}
```### Forms Methods
#### open([string $action])
#### close()
#### action($path)
#### method($name)
- get()
- post()
- put()
- patch()
- delete()#### horizontal([array $sizes])
#### inline()
#### required()
#### placeholder()
#### hideLabel()
#### lg()
#### sm()
### Fields Types
### Fields Methods
#### required()
Add attribute `required` in field.
#### optional()
Remove attribute `required` from field.
#### lg()
Add class `input-lg` in field.
#### sm()
Add class `input-sm` in field.
#### attr(string $name [, string $value])
Add an attribute with `data` in element. Example:
```php
{!! Form::text('Your Name', 'name')->attr('my-prop', 'value') !!}
```Output:
```html
Your Name
```#### removeAttr(string $name)
Remove an attribute from element.
#### data(string $name [, string $value])
Add an attribute with `data` in element. Example:
```php
{!! Form::text('Your Name', 'name')->data('my-prop', 'value') !!}
```Output:
```html
Your Name
```#### addClass(string $name)
Add an class in element. Example:
```php
{!! Form::text('Your Name', 'name')->addClass('material-design') !!}
```Output:
```html
Your Name
```#### removeClass(string $name)
Remove class from element.