06.10.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 501<br />

1 'avatar' => 'dimensions:min_width=100,min_height=200'<br />

Available constraints are: min_width, max_width, min_height, max_height, width, height, ratio.<br />

distinct<br />

When working with arrays, the field under validation must not have any duplicate values.<br />

1 'foo.*.id' => 'distinct'<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 />

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

Specifying A Custom Column Name<br />

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

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

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

These conditions may be negated using the ! sign:

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

Saved successfully!

Ooh no, something went wrong!