手机号码验证规则
'phone'=>'regex:/^1[34578][0-9]{9}$/', 'password' => 'required|min:6'
扩展
\Validator::extend('phone', function($attribute, $value, $parameters, $validator) { return preg_match('/^1[34578][0-9]{9}$/', $value); });
手机号码验证规则
'phone'=>'regex:/^1[34578][0-9]{9}$/', 'password' => 'required|min:6'
扩展
\Validator::extend('phone', function($attribute, $value, $parameters, $validator) { return preg_match('/^1[34578][0-9]{9}$/', $value); });
转载于:https://www.cnblogs.com/fenle/p/6233648.html