2017 © Pedro Peláez
 

library laravel-form

HTML Helper for Laravel Framework

image

vaneves/laravel-form

HTML Helper for Laravel Framework

  • Friday, December 1, 2017
  • by vaneves
  • Repository
  • 1 Watchers
  • 2 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Laravel Form

Installing with Composer

composer require vaneves/laravel-form

Configuration

Add the Form facade to the aliases array in config/app.php:, (*1)

'aliases' => [
    //...
    'Form' => Vaneves\Laravel\Form\Form::class,
]

Usage

Basic

{!! 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., (*2)

optional()

Remove attribute required from field., (*3)

lg()

Add class input-lg in field., (*4)

sm()

Add class input-sm in field., (*5)

attr(string $name [, string $value])

Add an attribute with data in element. Example:, (*6)

{!! Form::text('Your Name', 'name')->attr('my-prop', 'value') !!}

Output:, (*7)

<div class="form-group">
  <label for="name">Your Name</label>
  <input type="text" class="form-control" id="name" my-prop="value">
</div>

removeAttr(string $name)

Remove an attribute from element., (*8)

data(string $name [, string $value])

Add an attribute with data in element. Example:, (*9)

{!! Form::text('Your Name', 'name')->data('my-prop', 'value') !!}

Output:, (*10)

<div class="form-group">
  <label for="name">Your Name</label>
  <input type="text" class="form-control" id="name" data-my-prop="value">
</div>

addClass(string $name)

Add an class in element. Example:, (*11)

{!! Form::text('Your Name', 'name')->addClass('material-design') !!}

Output:, (*12)

<div class="form-group">
  <label for="name">Your Name</label>
  <input type="text" class="form-control material-design" id="name">
</div>

removeClass(string $name)

Remove class from element., (*13)

The Versions

01/12 2017

dev-master

9999999-dev

HTML Helper for Laravel Framework

  Sources   Download

Unlicense

by Valdirene Neves Junior

laravel form bootstrap