Support the ongoing development of →
Laravel Validation
Last updated 3 months ago.

you may be use like this to validate By default, when an attribute being validated is not present or contains an empty value as defined by the required rule, normal validation rules, including custom extensions, are not run. For example, the unique rule will not be run against a null value:

$rules = ['name' => 'unique'];

$input = ['name' => null];

Validator::make($input, $rules)->passes(); // true
For a rule to run even when an attribute is empty, the rule must imply that the attribute is required. To create such an "implicit" extension, use the Validator::extendImplicit() method:

Validator::extendImplicit('foo', function ($attribute, $value, $parameters, $validator) {
    return $value == 'foo';

more information :


what are you doing? What is the use of copying the contents of the manual? If you can't help me, please don't reply to these worthless answers.


Sign in to participate in this thread!


Your banner here too?

Nick Nick beagoodlearner Joined 13 Jun 2018


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

Your logo here?

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

© 2022 - All rights reserved.