Support the ongoing development of Laravel.io →
posted 9 years ago
Validation
Last updated 2 years ago.
0

Validator takes 2 associative array:

Validator::make(  $somethingToValidate, $rules);

Example:

$somethingToValidate = ['email'=>'[email protected]'];
$rules = ['email' => 'exists:staff,email,account_id,1'];

In this way rules defined at key 'email' are applied to value of key 'email' in $somethingToValidate array.

Usually the first parameter of Validator is Input::all() o Input::only() or Input::except().

0

Sign in to participate in this thread!

Eventy

Your banner here too?

VenomRush venomrush Joined 27 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.