app/Http/Requests/SuggestionRequest.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',
            'id'=>[
                function ($attribute, $value, $fail) {
                    if (!ConvenientInformation::where('id',$value)->first()) {
                        return $fail('举报不明确！');
                    }
                },
            ]
        ];
    }
public function rules ( ) { return [ 'content' => 'required' , 'id' => [ function ( $ attribute , $ value , $ fail ) { if ( ! ConvenientInformation :: where ( 'id' , $ value ) -> first ( ) ) { return $ fail ( '举报不明确！'); } } , ] ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .