raffaele / laravel_autovalidation
This package provides to autogenerate rules from database constraints with default message and autovalidate your model before save or update.
Requires
- php: >=5.6.0
- doctrine/dbal: ^2.5
This package is not auto-updated.
Last update: 2024-04-19 18:32:38 UTC
README
Installation
composer require raffaele/laravel_autovalidation
Usage Example
class YourModel extends raffaele\ValidationModel {
}
Disable automatic validate
Set in your model $autoValidate = false;
Array notValidate
If you wish exclude from validation some field, you have to add those to $notValidate = [] array.
Standard/custom validation message
Automatic validation uses the standarrd messages from laravel validation. If you want it's possibile use your custom messages, override $messages array.
Password and email fields
This fields have particolar rules, so if you have this fields thats have particolar name, please, help me to populate the
$passwordLabelCandidate and $emailLabelCandidate array.
Have fun! ;-)