Php 在laravel表单请求验证中与gte一起使用时,无法比较整型值和浮点值
我有两个属性lower和upper,我在表单请求类中使用如下类似的属性Php 在laravel表单请求验证中与gte一起使用时,无法比较整型值和浮点值,php,laravel,Php,Laravel,我有两个属性lower和upper,我在表单请求类中使用如下类似的属性 class MeasurementRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true;
class MeasurementRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'id' => 'required',
'lower' => 'numeric',
'upper' . => 'numeric|gte:lower'
];
}
}
当我将下限值传递为1,将上限值传递为4.2时,会抛出错误
"The upper must be greater than or equal 1."
这里的问题是什么,因为上大于下。我发现类型有一些问题。但不知道为什么。非常感谢您的帮助。什么是isodate?如果没有isodate,它将以
lower=>1,upper=>4.2来传递给我。输入错误我已经改正了如果它通过了我可以知道哪一个版本的laravel吗?我使用在Tinkerwell-@senty中测试的5.8.36I,但由于某些原因,它在这里不起作用