Download the PHP package artisaninweb/laravel-formvalidation-helper without Composer
On this page you can find all versions of the php package artisaninweb/laravel-formvalidation-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download artisaninweb/laravel-formvalidation-helper
More information about artisaninweb/laravel-formvalidation-helper
Files in artisaninweb/laravel-formvalidation-helper
Package laravel-formvalidation-helper
Short Description A helper to easy validate laravel forms.
License MIT
Informations about the package laravel-formvalidation-helper
Laravel form validation helper
A helper to easy validate laravel forms.
Installation
Add artisaninweb/laravel-formvalidation-helper
as requirement to composer.json
Replace 'Illuminate\Html\HtmlServiceProvider'
with 'Artisaninweb\FormValidationHelper\ServiceProvider'
Replace in aliases 'Form' => 'Illuminate\Support\Facades\Form'
with 'Form' => 'Artisaninweb\FormValidationHelper\Facades\Form'
Usage
The parameters to use:
required
(bool): Make the field required.
rules
(string): Specify the rules of the validation.
error-class
(string): Add a custom class to the form field on error (optional, default: 'error').
To output the error you can place this in your view.
Default the error wil come from the validator, you can edit this in /app/lang/{lang}/validation.php
.
Example:
After a form submit you can validate the last submitted form.
TwigBridge
If you are using https://github.com/rcrowe/TwigBridge
as TwigBirdge in Laravel (like i do).
You can replace 'TwigBridge\Extension\Laravel\Form'
with 'Artisaninweb\FormValidationHelper\Extension\TwigBridgeForm'
.
You will find this in app/config/packages/rcrowe/twigbridge/extensions
.