Generate PHP validations from short and concise descriptions of the input format.
npm install grunt-laravel-validator> Generate PHP validations from short and concise descriptions of the input format.
NOTE: This project is not related to the Laravel official Validator class. It's
a stricter and statically generated alternative to it.
To read more about the format of the validator files see the laravel-validator project directly.
~0.4.2If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
``shell`
npm install grunt-laravel-validator --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js`
grunt.loadNpmTasks('grunt-laravel-validator');
to the data object passed into grunt.initConfig().`js
grunt.initConfig({
laravel_validator: {
target: {
files: {
// Target-specific file lists go here.
},
},
},
})
`
$3
#### All validator files
In this example all files from the "app/validators" folder will be converted and output
to the "app/lib/Validators" directory.
`js
grunt.initConfig({
laravel_validator: {
all: {
files: [
{
src: '*/.js',
cwd: 'app/validators',
dest: 'app/lib/Validators',
expand: true,
},
],
},
},
})
``