request()->validate([
'hours' => ['numeric', 'regex:/^\d{1,2}(.\d{1,2})?$/', function($attribute, $value, $fail) {
if ($value > 24.00) {
$fail('The ' . $attribute . ' field must be less than or equal to 24.00.');
}
}],
]);
@Snapey you gathered that the premise is wrong based off of my very simple demo?
Validate as decimal exactly worked for my needs.
Im handling other entries differently.
What would you propose as a proper time picker.
I came for a solution, not just to be told what I'm doing is incorrect, neither of your inputs were helpful or provided any solution.
@catalyph I don't know your use case to offer any solution. I'm only guessing that you are asking the user to enter a duration of up to a day? I can't really say without knowing in what circumstance the user might enter 7.5 or 24