I gotta validate a price field which needs to be greater than zero (0.01 is valid) so I have the following validation:
$request->validate([
'product_price' => 'required|numeric|gt:0',
]);
The problem is that when I enter a string in the 'product_price' field I'm getting an error:
InvalidArgumentException The values under comparison must be of the same type
why is that? I mean, I'm checking that it should be numeric before even checking that it's > 0