You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i want to use gte and lte rules, but when passing a field gives an error how can i manage that?
right now i am using a custom rule like this one
->rules([
fn (Get$get): Closure => function (string$attribute, $value, Closure$fail) use ($get) {
$minAmount = $get('min_amount');
$maxAmount = $get('max_amount');
// Convierte los valores a numéricos si es necesario$value = floatval($value);
$minAmount = floatval($minAmount);
$maxAmount = floatval($maxAmount);
// Verifica que applied_amount esté dentro del rangoif ($value <= $minAmount) {
$fail("The {$attribute} must be greater than or equal to the minimum amount.");
}
if ($value >= $maxAmount) {
$fail("The {$attribute} must be less than or equal to the maximum amount.");
}
},
])
The text was updated successfully, but these errors were encountered:
i want to use gte and lte rules, but when passing a field gives an error how can i manage that?
right now i am using a custom rule like this one
The text was updated successfully, but these errors were encountered: