app/Http/Requests/ShopCommentRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        return [
            'content'=>'required',
            'star'=>['required','in:star,1,2,3,4,5'],
        ];
    }
public function rules ( ) { return [ 'content' => 'required' , 'star' => [ 'required' , 'in:star,1,2,3,4,5' ] , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .
//            'shop_id'=>['required', //                function ($attribute, $value, $fail) { //                    if (!Shop::where('id',$value)->first()) { //                        return $fail('分类有问题！'); //                    } //                }, //            ]