ParsleyJS-LaraExtras

These are some extra rules for parsley.js that are actually translated from
Laravel's server-side validation rules.

Learn more

In rules

in
Value should be one of the following: cheese,apple,cake,fries
not_in
Value should not be one of the following: cheese,apple,cake,fries

Different

different
Value should be different from the right one

Size rules

between
Value should be between 2 and 6
size
Value should be 6
size
Value should be 6 characters long

Date rules moment.js

date
Value should be a valid date
date_format
Value should be a date according to this format: d-m-Y
before
Value should be a date before: 12/02/2015
before
Value should be a date that happens before the left input
after
Value should be a date after: 12/02/2015
after
Value should be a date that happens after the left input

Miscellaneous

distinct
  • Blue
  • Green
  • Blue
  • Green
All selected checkboxes should have a unique value
in_array
Value should be one of the values in the input on your right
in_array
Value should be one of the values of the selected checkboxes to your right
  • Blue
  • Green
  • Red
  • Yellow

Required rules

required_if
This value is only required if the right input contains any of these values: cheese,apple,cake,fries
required_unless
This value is required unless the right input contains any of these values: cheese,apple,cake,fries
required_with
This value is required if any of the inputs on the right have a value.
required_with_all
This value is required if all of the inputs on the right have a value.
required_without
This value is required if any of the inputs on the right don't have a value.
required_without_all
This value is required if all of the inputs on the right don't have a value.

Files rules

max
The maximum file size is 200Kb
min
The minimum file size is 200Kb
between
The file should be between 5 & 29 MB
image
The file should be an image
mimetypes
The file should be a pdf
mimetypes
The file should be a pdf by file extension
dimensions
The image should have a min width of 100px
dimensions
The image should have a max width of 100px
dimensions
The image should have a min height of 100px
dimensions
The image should have a max height of 100px
dimensions
The image should have a width of 100px
dimensions
The image should have a height of 100px
dimensions
The image should have ratio of 1:1