06.10.2016 Views

laravel-5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Validation 504<br />

nullable<br />

The field under validation may be null. This is particularly useful when validating primitive such<br />

as strings and integers that can contain null values.<br />

not_in:foo,bar,…<br />

The field under validation must not be included in the given list of values.<br />

numeric<br />

The field under validation must be numeric.<br />

present<br />

The field under validation must be present in the input data but can be empty.<br />

regex:pattern<br />

The field under validation must match the given regular expression.<br />

Note: When using the regex pattern, it may be necessary to specify rules in an array instead of<br />

using pipe delimiters, especially if the regular expression contains a pipe character.<br />

required<br />

The field under validation must be present in the input data and not empty. A field is considered<br />

“empty” if one of the following conditions are true:<br />

• The value is null.<br />

• The value is an empty string.<br />

• The value is an empty array or empty Countable object.<br />

• The value is an uploaded file with no path.<br />

required_if:anotherfield,value,…<br />

The field under validation must be present and not empty if the anotherfield field is equal to any<br />

value.<br />

required_unless:anotherfield,value,…<br />

The field under validation must be present and not empty unless the anotherfield field is equal to<br />

any value.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!