validation.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. return [
  12. /*
  13. |--------------------------------------------------------------------------
  14. | Validation Language Lines
  15. |--------------------------------------------------------------------------
  16. |
  17. | The following language lines contain the default error messages used by
  18. | the validator class. Some of these rules have multiple versions such
  19. | as the size rules. Feel free to tweak each of these messages here.
  20. |
  21. */
  22. 'accepted' => ':attribute 必须接受',
  23. 'active_url' => ':attribute 必须是一个合法的 URL',
  24. 'after' => ':attribute 必须是 :date 之后的一个日期',
  25. 'after_or_equal' => ':attribute 必须是 :date 之后或相同的一个日期',
  26. 'alpha' => ':attribute 只能包含字母',
  27. 'alpha_dash' => ':attribute 只能包含字母、数字、中划线或下划线',
  28. 'alpha_num' => ':attribute 只能包含字母和数字',
  29. 'array' => ':attribute 必须是一个数组',
  30. 'before' => ':attribute 必须是 :date 之前的一个日期',
  31. 'before_or_equal' => ':attribute 必须是 :date 之前或相同的一个日期',
  32. 'between' => [
  33. 'numeric' => ':attribute 必须在 :min 到 :max 之间',
  34. 'file' => ':attribute 必须在 :min 到 :max kb 之间',
  35. 'string' => ':attribute 必须在 :min 到 :max 个字符之间',
  36. 'array' => ':attribute 必须在 :min 到 :max 项之间',
  37. ],
  38. 'boolean' => ':attribute 字符必须是 true 或 false, 1 或 0',
  39. 'confirmed' => ':attribute 二次确认不匹配',
  40. 'date' => ':attribute 必须是一个合法的日期',
  41. 'date_format' => ':attribute 与给定的格式 :format 不符合',
  42. 'decimal' => ':attribute 必须有 :decimal 位小数',
  43. 'different' => ':attribute 必须不同于 :other',
  44. 'digits' => ':attribute 必须是 :digits 位',
  45. 'digits_between' => ':attribute 必须在 :min 和 :max 位之间',
  46. 'dimensions' => ':attribute 具有无效的图片尺寸',
  47. 'distinct' => ':attribute 字段具有重复值',
  48. 'email' => ':attribute 必须是一个合法的电子邮件地址',
  49. 'exists' => '选定的 :attribute 是无效的',
  50. 'file' => ':attribute 必须是一个文件',
  51. 'filled' => ':attribute 的字段是必填的',
  52. 'gt' => [
  53. 'numeric' => ':attribute 必须大于 :value',
  54. 'file' => ':attribute 必须大于 :value kb',
  55. 'string' => ':attribute 必须大于 :value 个字符',
  56. 'array' => ':attribute 必须大于 :value 项',
  57. ],
  58. 'gte' => [
  59. 'numeric' => ':attribute 必须大于等于 :value',
  60. 'file' => ':attribute 必须大于等于 :value kb',
  61. 'string' => ':attribute 必须大于等于 :value 个字符',
  62. 'array' => ':attribute 必须大于等于 :value 项',
  63. ],
  64. 'image' => ':attribute 必须是 jpg, jpeg, png, bmp 或者 gif 格式的图片',
  65. 'in' => '选定的 :attribute 是无效的',
  66. 'in_array' => ':attribute 字段不存在于 :other',
  67. 'integer' => ':attribute 必须是个整数',
  68. 'ip' => ':attribute 必须是一个合法的 IP 地址',
  69. 'ipv4' => ':attribute 必须是一个合法的 IPv4 地址',
  70. 'ipv6' => ':attribute 必须是一个合法的 IPv6 地址',
  71. 'json' => ':attribute 必须是一个合法的 JSON 字符串',
  72. 'list' => ':attribute 必须是一个数组列表',
  73. 'lt' => [
  74. 'numeric' => ':attribute 必须小于 :value',
  75. 'file' => ':attribute 必须小于 :value kb',
  76. 'string' => ':attribute 必须小于 :value 个字符',
  77. 'array' => ':attribute 必须小于 :value 项',
  78. ],
  79. 'lte' => [
  80. 'numeric' => ':attribute 必须小于等于 :value',
  81. 'file' => ':attribute 必须小于等于 :value kb',
  82. 'string' => ':attribute 必须小于等于 :value 个字符',
  83. 'array' => ':attribute 必须小于等于 :value 项',
  84. ],
  85. 'max' => [
  86. 'numeric' => ':attribute 的最大值为 :max',
  87. 'file' => ':attribute 的最大为 :max kb',
  88. 'string' => ':attribute 的最大长度为 :max 字符',
  89. 'array' => ':attribute 至多有 :max 项',
  90. ],
  91. 'mimes' => ':attribute 的文件类型必须是 :values',
  92. 'mimetypes' => ':attribute 的文件MIME必须是 :values',
  93. 'min' => [
  94. 'numeric' => ':attribute 的最小值为 :min',
  95. 'file' => ':attribute 大小至少为 :min kb',
  96. 'string' => ':attribute 的最小长度为 :min 字符',
  97. 'array' => ':attribute 至少有 :min 项',
  98. ],
  99. 'not_in' => '选定的 :attribute 是无效的',
  100. 'not_regex' => ':attribute 不能匹配给定的正则',
  101. 'numeric' => ':attribute 必须是数字',
  102. 'present' => ':attribute 字段必须存在',
  103. 'regex' => ':attribute 格式是无效的',
  104. 'required' => ':attribute 字段是必须的',
  105. 'required_if' => ':attribute 字段是必须的当 :other 是 :value',
  106. 'required_unless' => ':attribute 字段是必须的,除非 :other 是在 :values 中',
  107. 'required_with' => ':attribute 字段是必须的当 :values 是存在的',
  108. 'required_with_all' => ':attribute 字段是必须的当 :values 是存在的',
  109. 'required_without' => ':attribute 字段是必须的当 :values 是不存在的',
  110. 'required_without_all' => ':attribute 字段是必须的当 没有一个 :values 是存在的',
  111. 'same' => ':attribute 和 :other 必须匹配',
  112. 'size' => [
  113. 'numeric' => ':attribute 必须是 :size',
  114. 'file' => ':attribute 必须是 :size kb',
  115. 'string' => ':attribute 必须是 :size 个字符',
  116. 'array' => ':attribute 必须包括 :size 项',
  117. ],
  118. 'starts_with' => ':attribute 必须以 :values 为开头',
  119. 'string' => ':attribute 必须是一个字符串',
  120. 'timezone' => ':attribute 必须是个有效的时区',
  121. 'unique' => ':attribute 已存在',
  122. 'uploaded' => ':attribute 上传失败',
  123. 'url' => ':attribute 无效的格式',
  124. 'uuid' => ':attribute 无效的UUID格式',
  125. 'max_if' => [
  126. 'numeric' => '当 :other 为 :value 时 :attribute 不能大于 :max',
  127. 'file' => '当 :other 为 :value 时 :attribute 不能大于 :max kb',
  128. 'string' => '当 :other 为 :value 时 :attribute 不能大于 :max 个字符',
  129. 'array' => '当 :other 为 :value 时 :attribute 最多只有 :max 个单元',
  130. ],
  131. 'min_if' => [
  132. 'numeric' => '当 :other 为 :value 时 :attribute 必须大于等于 :min',
  133. 'file' => '当 :other 为 :value 时 :attribute 大小不能小于 :min kb',
  134. 'string' => '当 :other 为 :value 时 :attribute 至少为 :min 个字符',
  135. 'array' => '当 :other 为 :value 时 :attribute 至少有 :min 个单元',
  136. ],
  137. 'between_if' => [
  138. 'numeric' => '当 :other 为 :value 时 :attribute 必须介于 :min - :max 之间',
  139. 'file' => '当 :other 为 :value 时 :attribute 必须介于 :min - :max kb 之间',
  140. 'string' => '当 :other 为 :value 时 :attribute 必须介于 :min - :max 个字符之间',
  141. 'array' => '当 :other 为 :value 时 :attribute 必须只有 :min - :max 个单元',
  142. ],
  143. /*
  144. |--------------------------------------------------------------------------
  145. | Custom Validation Language Lines
  146. |--------------------------------------------------------------------------
  147. |
  148. | Here you may specify custom validation messages for attributes using the
  149. | convention "attribute.rule" to name the lines. This makes it quick to
  150. | specify a specific custom language line for a given attribute rule.
  151. |
  152. */
  153. 'custom' => [
  154. 'attribute-name' => [
  155. 'rule-name' => 'custom-message',
  156. ],
  157. ],
  158. /*
  159. |--------------------------------------------------------------------------
  160. | Custom Validation Attributes
  161. |--------------------------------------------------------------------------
  162. |
  163. | The following language lines are used to swap attribute place-holders
  164. | with something more reader friendly such as E-Mail Address instead
  165. | of "email". This simply helps us make messages a little cleaner.
  166. |
  167. */
  168. 'attributes' => [],
  169. 'phone_number' => ':attribute 必须为一个有效的电话号码',
  170. 'telephone_number' => ':attribute 必须为一个有效的手机号码',
  171. 'chinese_word' => ':attribute 必须包含以下有效字符 (中文/英文,数字, 下划线)',
  172. 'sequential_array' => ':attribute 必须是一个有序数组',
  173. ];