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|Stringable|ValidationRule $rules, array|Closure|Rule|string|Stringable|ValidationRule $defaultRules = [])
Create a new conditional rules instance.
bool
passes(array $data = [])
Determine if the conditional rules should be added.
array
rules(array $data = [])
Get the rules.
array
defaultRules(array $data = [])
Get the default rules.
Details
at line 28
__construct(bool|callable $condition, array|Closure|Rule|string|Stringable|ValidationRule $rules, array|Closure|Rule|string|Stringable|ValidationRule $defaultRules = [])
Create a new conditional rules instance.
at line 41
bool
passes(array $data = [])
Determine if the conditional rules should be added.
at line 51
array
rules(array $data = [])
Get the rules.
at line 61
array
defaultRules(array $data = [])
Get the default rules.