29.07.2016 Views

laravel-5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Validation 383<br />

different:field<br />

The field under validation must have a different value than field.<br />

digits:value<br />

The field under validation must be numeric and must have an exact length of value.<br />

digits_between:min,max<br />

The field under validation must have a length between the given min and max.<br />

email<br />

The field under validation must be formatted as an e-mail address.<br />

exists:table,column<br />

The field under validation must exist on a given database table.<br />

Basic Usage Of Exists Rule<br />

.<br />

1 'state' => 'exists:states'<br />

Specifying A Custom Column Name<br />

.<br />

1 'state' => 'exists:states,abbreviation'<br />

You may also specify more conditions that will be added as “where” clauses to the query:<br />

.<br />

1 'email' => 'exists:staff,email,account_id,1'<br />

Passing NULL as a “where” clause value will add a check for a NULL database value:

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

Saved successfully!

Ooh no, something went wrong!