jonhoo / laravel-former

Simple Laravel form library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Former

Former is a form library for Laravel that provides HTML5 form field types, validation and various other convenient luxuries for modern app development.

Build status: Build Status

Notes on usage until examples are in place

Former will validate all data that is passed to it, but will not change the array that is given to it. To avoid mass-assignment attacks and such, use

$form = new Form(/* ... */);
$form->setInput(Input::all());
$validator = $form->accept();
if (!$validator->fails()) {
  $data = $validator->getData();
  // Work with $data, NOT Input::all()!
}

Installing

  • Install Composer and place the executable somewhere in your $PATH (for the rest of this README, I'll reference it as just composer)

  • Add jonhoo/former to your project's `composer.json:

{
    "require": {
        "jonhoo/former": "0.*"
    }
}
  • Install/update your dependencies
$ cd my_project
$ composer install

And you're good to go! Have a look at the example files in examples/ to see how you might go about using Former.

About

Simple Laravel form library

License:MIT License


Languages

Language:PHP 87.0%Language:CSS 13.0%