🛢 Pipeline
v1.2 - 27 February, 2022
Added
added support for functional mode
Just like most of leaf's modules, leaf form now supports functional mode. This means that you can call form from anywhere in your application.
form()->errors();inline validation
This version allows you to quickly perform some checks without having to use arrays in your code.
form()->validate('name', 'required');added date validator
Leaf form now allows you to validate whether a string is a valid date or not.
form()->validate('joined', 'date');custom error messages
This has been one of the most sought after features in leaf form, and now it comes pre-packaged in this version. Using custom error messages, you can take your app a step further with multilingual support.
form()->messages('nospaces', '{field} no puede contener espacios');Note the use of {field}. This is a mini template that tells leaf to replace {field} with the current field. So in this case:
$validation = form()->validate('firstname', 'nospaces');{field} will be replaced with firstname. Leaf form also supports {value} and {params} which are basically the value of the field being checked and parameters passed into the current rule if any.
Fixed
- fixed broken
nospacescheck - Fixed wrong phpdoc references