Determine if the user is authorized to make this request.
Returns
boolean
rules()
rules() : array
Get the validation rules that apply to the request.
Returns
array
attributes()
attributes()
CommentRequest.php
<?phpnamespaceApp\Http\Requests\Api;classCommentRequestextendsFormRequest{/**
* Get the validation rules that apply to the request.
*
* @return array
*/publicfunctionrules(){return['content'=>'required|min:2',];}publicfunctionattributes(){return['content'=>'评论内容',];}}