ConditionalRules
class ConditionalRules
Properties
| protected bool|Closure | $condition | The boolean condition indicating if the rules should be added to the attribute. |
Methods
__construct(bool|callable $condition, array|Closure|Rule|string|ValidationRule $rules, array|Closure|Rule|string|ValidationRule $defaultRules = [])
Create a new conditional rules instance.
bool
passes(array $data = [])
Determine if the conditional rules should be added.
mixed
rules(array $data = [])
Get the rules.
mixed
defaultRules(array $data = [])
Get the default rules.
Details
at line 26
__construct(bool|callable $condition, array|Closure|Rule|string|ValidationRule $rules, array|Closure|Rule|string|ValidationRule $defaultRules = [])
Create a new conditional rules instance.
at line 37
bool
passes(array $data = [])
Determine if the conditional rules should be added.
at line 49
mixed
rules(array $data = [])
Get the rules.
at line 61
mixed
defaultRules(array $data = [])
Get the default rules.