-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
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;
}
// ...
- You are type hinting
Laravel's Validatorhere which results in a new instance Validator::extend()wont extendlaracasts/validation's instance of ValidatorLaravelValidatoris missing anextend()method to get around this
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:
$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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels