gpt4 book ai didi

javascript - 方法 [validateNumberic] 不存在

转载 作者:行者123 更新时间:2023-11-29 10:30:06 26 4
gpt4 key购买 nike

我的 Controller 是-

public function handleHome(Request $request) {
$input = $request - > all();
$validator = Validator::make($input, [
'a' => 'required|max:255',
'b' => 'required|numberic',
'c' => 'required',
], [
'required' => 'Bat buoc phai nhap',
'numberic' => 'Can nhap so',
]);
if ($validator - > fails()) {
return redirect('home') -
>
withErrors($validator) -
>
withInput();
} else {
return redirect('home') - > with('message', 'everthing is good');
}
}

最佳答案

numberic 更改为 numeric:

'b' => 'required|numeric',

https://laravel.com/docs/5.5/validation#rule-numeric

关于javascript - 方法 [validateNumberic] 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48358318/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com