'nullable|string|max:255|required_with:tax_code', 'tax_code' => ['nullable', 'string', 'regex:/^\d{10}(-\d{3})?$/'], 'invoice_address' => 'nullable|string|max:500', 'invoice_email' => 'nullable|email|max:255', ]; } public function messages(): array { return [ 'tax_code.regex' => 'Mã số thuế phải gồm 10 số hoặc 13 số (dạng 0123456789-001)', 'invoice_company.required_with' => 'Vui lòng nhập tên đơn vị khi có mã số thuế', 'invoice_email.email' => 'Email nhận hóa đơn không hợp lệ', ]; } }