app/Http/Requests/Api/MessageRequest.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 [
            'username' => ['max:10', 'min:2'],
            'mobile'   => ['sometimes', 'required', 'regex:' . getMobileCheckRegex()],
            'content'  => ['required', 'min:10'],
        ];
    }
public function rules ( ) { return [ 'username' => [ 'max:10' , 'min:2' ] , 'mobile' => [ 'sometimes' , 'required' , 'regex:' . getMobileCheckRegex ( ) ] , 'content' => [ 'required' , 'min:10' ] , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .