Open hettiger opened 10 years ago
Please correct me if I'm wrong with anything written below but ...
I think it is impossible to add custom validation rules when using laracasts/validation.
class LaravelValidator implements FactoryInterface { // ... /** * @param Validator $validator */ function __construct(Validator $validator) { $this->validator = $validator; } // ...
Laravel's Validator
Validator::extend()
laracasts/validation's instance of Validator
LaravelValidator
extend()
I don't think that I'm doing something wrong because my custom validation rule is working if I do the following in php artisan tinker:
php artisan tinker
$validator = Validator::make(['test' => 'foo'], ['test' => 'bar']); $validator->fails();
Is there any other way to extend it easily that I missed? If so an update to the docs would be awesome.
I got the same issue and have no clue.
I am using Regex:/^$/i rule as a workaround.
Regex:/^$/i
Please correct me if I'm wrong with anything written below but ...
I think it is impossible to add custom validation rules when using laracasts/validation.
Laravel's Validator
here which results in a new instanceValidator::extend()
wont extendlaracasts/validation's instance of Validator
LaravelValidator
is missing anextend()
method to get around thisI don't think that I'm doing something wrong because my custom validation rule is working if I do the following in
php artisan tinker
:Is there any other way to extend it easily that I missed? If so an update to the docs would be awesome.