我们如何在jquery中使用验证laravel

时间:2017-07-04 09:27:06

标签: jquery laravel validation

如何将validation laraveljquery

一起使用

我尝试使用laravel验证

$this->validate($request, [
            'branch' => 'required|not_in:---Select Branch---',
            'dep' => 'required|not_in:--- Select Department ---',
            'txt_phone' => 'required|numeric|min:8',
            'txt_ext' => 'required|min:3|max:5' ], [
            'txt_phone.min' => 'Phone at least 9 characters',
            'txt_phone.max' => 'Phone not be greater than 10 characters',
            'txt_phone.numeric' => 'Phone must be nummeric']);

validate server validate client jquery [u'2.40', u'2.35', u'2.67'] [2.40, 2.35, 2.67] {{1}}怎么办?{/ 1} >

1 个答案:

答案 0 :(得分:0)

你可以退货

if ($validator->fails()) {
    return $validator->errors();
}

返回ajax