我已经在Laravel中验证了基于阿联酋的电话号码。有什么方法可以验证所有国家/地区的号码(不仅限于阿联酋)?
$messages = [
'required' => 'The :attribute field is required.',
'integer' => 'The :attribute field value should be an integer.',
'regex' => 'The :attribute is invalid',
'digits' => 'The :attribute is invalid',
];
$validator = Validator::make($request->all(),
[
'number' => 'required|digits:12|regex:/(9715)[0-9]{8}/',
'service' => 'required|integer'
],
$messages
);