Can I use Validator to verify a given set of data?
public function store(PincardRequest $request){
这个是方法
}
The following is verification
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
class PincardRequest extends Request
{
/**
* 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 [
'yd'=>array('required','regex:/\p{Han}/u'),
];
}
public function messages(){
return [
'yd.required'=>'不能为空!',
];
}
}
How do I pass yd to the store for verification
Thank you, you can do this. Add the following two methods in the controller. If you need to pass array verification, use the following methods
That one. . . What does array submission mean? ? ?