| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 | <?phpnamespace App\Http\Requests\Server;use App\Http\Requests\Request;class SaveRequest 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()    {        if (!$this->ajax()) {            return [];        }        return [            'server_name' => 'required',            'server_ip' => 'required',            'server_user_name' => 'required',            'server_passwd' => 'required',            'server_description' => 'nullable',            'server_type' => 'required',            'mysql_user_name' => 'required',            'mysql_passwd' => 'required',        ];    }    public function attributes()    {        return [            'server_name' => '服务器名称',            'server_ip' => '服务器IP',            'server_user_name' => '服务器用户名',            'server_passwd' => '服务器密码',            'server_description' => '服务器描述',            'server_type' => '服务器类型',            'mysql_user_name' => 'Mysql用户名',            'mysql_passwd' => 'Mysql密码',        ];    }}
 |