laravel-learn-bbs/app/Http/Requests/Api/VerificationCodeRequest.php
2018-06-03 16:11:51 +08:00

35 lines
695 B
PHP

<?php
namespace App\Http\Requests\Api;
use Illuminate\Foundation\Http\FormRequest;
class VerificationCodeRequest 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 [
'phone' => [
'required',
'regex:/^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\d{8}$/',
'unique:users'
]
];
}
}