This is where your description should go. Take a look at contributing.md to see a to do list.
Via Composer
$ composer require bewarhizirvan/laravel-form
For initiating new form
$form = new \BewarHizirvan\LaravelForm\LaravelForm($parameters);
$parameters must be an array and is optional, all keys are optional
title : Form Title
name : Form name
method : Form method { get, post (default), put, patch } class : Form class
role : Form role
dir : Form direction { right, left (default) }
id : Form id
file : if you set a value to it , the Form will have enctype="multipart/form-data"
submit : Form submit button title, if you set it to 'none' it will be removed
back_url : Form Back button URL, if you set it to 'none' it will be removed
For form action One of these you can use {default is ''}
url : Full URL
route : Route { only route string or array Laravel Style }
action : Action { only action string or array Laravel Style }
$form->addText($name = null, $value = '', $attributes = [], $label = null, $label_attributes = [], $div_attributes = [])
$form->addFile($name = null, $value = '', $attributes = [], $label = null, $label_attributes = [], $div_attributes = [])
$form->addButton($label = '', $attributes = [])
$form->addHidden($name = null, $value = '', $attributes = [])
$form->addSelect($name= null, $options = [], $value='',$attributes = [],$label=null, $label_attributes = [], $div_attributes = [])
$form->addTextArea($name = null, $value = '', $attributes = [], $label = null, $label_attributes = [], $div_attributes = [])
$form->addCheckbox($name = null, $value = 1, $checked = false, $attributes = [], $label = null, $label_attributes = [], $div_attributes = [])
$form->addCheckboxGroup($name = null, $checkboxes = [], $checked_list = [], $attributes = [], $label = null, $label_attributes = [], $div_attributes = [])
$form->addRadioGroup($name = null, $radios = [], $checked = '', $attributes = [], $label = null, $label_attributes = [], $div_attributes = [])
$form->addTable($label = '', $table_data = [], $label_attributes = [], $table_attributes = [], $thead_attributes = [], $tbody_attributes = [], $tfoot_attributes = [], $div_attributes = [])
For all function if $label = null, the the function will set $label = trans("db.$name")
$table_data = [
'names' => [],
'inputs' => [],
'sums' => [],
'buttons' => [],
];
$form = $form->render();
the above step will generate an html code
$form = new \BewarHizirvan\LaravelForm\LaravelForm($parameters);
$form->addText('email');
$form->addText('name');
$form->addText('password', '', ['type' => 'password']);
$form = $form ->render();
\BewarHizirvan\LaravelForm\LaravelForm::redirect($route = '/');
The above function will check the $request for back_url, if it is set it will redirect to it else it will redirect to the provided route
Please see the changelog for more information on what has changed recently.
$ composer test
Please see contributing.md for details and a todolist.
MIT. Please see the license file for more information.