Skip to content

Commit 67e7469

Browse files
committed
Shorten and simplify validation messages
1 parent 4967c94 commit 67e7469

File tree

1 file changed

+220
-0
lines changed

1 file changed

+220
-0
lines changed

lang/en/validation.php

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Validation Language Lines
8+
|--------------------------------------------------------------------------
9+
*/
10+
11+
'required' => 'Required',
12+
'string' => 'Must be a string',
13+
'min' => [
14+
'array' => 'Must have at least :min items',
15+
'file' => 'Must be at least :min KB',
16+
'numeric' => 'Must be at least :min',
17+
'string' => 'Must have at least :min characters',
18+
],
19+
'max' => [
20+
'array' => 'Must have less than :max items',
21+
'file' => 'Must have less than :max KB',
22+
'numeric' => 'Must be less than or equal to :max',
23+
'string' => 'Must have less than :max characters',
24+
],
25+
'email' => 'Must be a valid email address',
26+
'numeric' => 'Must be a number',
27+
'integer' => 'Must be an integer',
28+
'date' => 'Must be a date',
29+
'date_equals' => 'Must be a date equal to :date',
30+
'after_or_equal' => 'Must be a date after or equal to :date',
31+
'array' => 'Must be an array',
32+
'enum' => 'Invalid',
33+
34+
/*
35+
|--------------------------------------------------------------------------
36+
| Custom Validation Language Lines
37+
|--------------------------------------------------------------------------
38+
|
39+
| Here you may specify custom validation messages for attributes using the
40+
| convention "attribute.rule" to name the lines. This makes it quick to
41+
| specify a specific custom language line for a given attribute rule.
42+
|
43+
*/
44+
45+
// 'custom' => [
46+
// 'attribute-name' => [
47+
// 'rule-name' => 'custom-message',
48+
// ],
49+
// ],
50+
51+
/*
52+
|--------------------------------------------------------------------------
53+
| Custom Validation Attributes
54+
|--------------------------------------------------------------------------
55+
|
56+
| The following language lines are used to swap our attribute placeholder
57+
| with something more reader friendly such as "E-Mail Address" instead
58+
| of "email". This simply helps us make our message more expressive.
59+
|
60+
*/
61+
62+
// 'attributes' => [],
63+
64+
];
65+
66+
/*
67+
|--------------------------------------------------------------------------
68+
| Default values
69+
|--------------------------------------------------------------------------
70+
*/
71+
// 'accepted' => 'The :attribute field must be accepted.',
72+
// 'accepted_if' => 'The :attribute field must be accepted when :other is :value.',
73+
// 'active_url' => 'The :attribute field must be a valid URL.',
74+
// 'after' => 'The :attribute field must be a date after :date.',
75+
// 'after_or_equal' => 'The :attribute field must be a date after or equal to :date.',
76+
// 'alpha' => 'The :attribute field must only contain letters.',
77+
// 'alpha_dash' => 'The :attribute field must only contain letters, numbers, dashes, and underscores.',
78+
// 'alpha_num' => 'The :attribute field must only contain letters and numbers.',
79+
// 'any_of' => 'The :attribute field is invalid.',
80+
// 'array' => 'The :attribute field must be an array.',
81+
// 'ascii' => 'The :attribute field must only contain single-byte alphanumeric characters and symbols.',
82+
// 'before' => 'The :attribute field must be a date before :date.',
83+
// 'before_or_equal' => 'The :attribute field must be a date before or equal to :date.',
84+
// 'between' => [
85+
// 'array' => 'The :attribute field must have between :min and :max items.',
86+
// 'file' => 'The :attribute field must be between :min and :max kilobytes.',
87+
// 'numeric' => 'The :attribute field must be between :min and :max.',
88+
// 'string' => 'The :attribute field must be between :min and :max characters.',
89+
// ],
90+
// 'boolean' => 'The :attribute field must be true or false.',
91+
// 'can' => 'The :attribute field contains an unauthorized value.',
92+
// 'confirmed' => 'The :attribute field confirmation does not match.',
93+
// 'contains' => 'The :attribute field is missing a required value.',
94+
// 'current_password' => 'The password is incorrect.',
95+
// 'date' => 'The :attribute field must be a valid date.',
96+
// 'date_equals' => 'The :attribute field must be a date equal to :date.',
97+
// 'date_format' => 'The :attribute field must match the format :format.',
98+
// 'decimal' => 'The :attribute field must have :decimal decimal places.',
99+
// 'declined' => 'The :attribute field must be declined.',
100+
// 'declined_if' => 'The :attribute field must be declined when :other is :value.',
101+
// 'different' => 'The :attribute field and :other must be different.',
102+
// 'digits' => 'The :attribute field must be :digits digits.',
103+
// 'digits_between' => 'The :attribute field must be between :min and :max digits.',
104+
// 'dimensions' => 'The :attribute field has invalid image dimensions.',
105+
// 'distinct' => 'The :attribute field has a duplicate value.',
106+
// 'doesnt_end_with' => 'The :attribute field must not end with one of the following: :values.',
107+
// 'doesnt_start_with' => 'The :attribute field must not start with one of the following: :values.',
108+
// 'email' => 'The :attribute field must be a valid email address.',
109+
// 'ends_with' => 'The :attribute field must end with one of the following: :values.',
110+
// 'enum' => 'The selected :attribute is invalid.',
111+
// 'exists' => 'The selected :attribute is invalid.',
112+
// 'extensions' => 'The :attribute field must have one of the following extensions: :values.',
113+
// 'file' => 'The :attribute field must be a file.',
114+
// 'filled' => 'The :attribute field must have a value.',
115+
// 'gt' => [
116+
// 'array' => 'The :attribute field must have more than :value items.',
117+
// 'file' => 'The :attribute field must be greater than :value kilobytes.',
118+
// 'numeric' => 'The :attribute field must be greater than :value.',
119+
// 'string' => 'The :attribute field must be greater than :value characters.',
120+
// ],
121+
// 'gte' => [
122+
// 'array' => 'The :attribute field must have :value items or more.',
123+
// 'file' => 'The :attribute field must be greater than or equal to :value kilobytes.',
124+
// 'numeric' => 'The :attribute field must be greater than or equal to :value.',
125+
// 'string' => 'The :attribute field must be greater than or equal to :value characters.',
126+
// ],
127+
// 'hex_color' => 'The :attribute field must be a valid hexadecimal color.',
128+
// 'image' => 'The :attribute field must be an image.',
129+
// 'in' => 'The selected :attribute is invalid.',
130+
// 'in_array' => 'The :attribute field must exist in :other.',
131+
// 'integer' => 'The :attribute field must be an integer.',
132+
// 'ip' => 'The :attribute field must be a valid IP address.',
133+
// 'ipv4' => 'The :attribute field must be a valid IPv4 address.',
134+
// 'ipv6' => 'The :attribute field must be a valid IPv6 address.',
135+
// 'json' => 'The :attribute field must be a valid JSON string.',
136+
// 'list' => 'The :attribute field must be a list.',
137+
// 'lowercase' => 'The :attribute field must be lowercase.',
138+
// 'lt' => [
139+
// 'array' => 'The :attribute field must have less than :value items.',
140+
// 'file' => 'The :attribute field must be less than :value kilobytes.',
141+
// 'numeric' => 'The :attribute field must be less than :value.',
142+
// 'string' => 'The :attribute field must be less than :value characters.',
143+
// ],
144+
// 'lte' => [
145+
// 'array' => 'The :attribute field must not have more than :value items.',
146+
// 'file' => 'The :attribute field must be less than or equal to :value kilobytes.',
147+
// 'numeric' => 'The :attribute field must be less than or equal to :value.',
148+
// 'string' => 'The :attribute field must be less than or equal to :value characters.',
149+
// ],
150+
// 'mac_address' => 'The :attribute field must be a valid MAC address.',
151+
// 'max' => [
152+
// 'array' => 'The :attribute field must not have more than :max items.',
153+
// 'file' => 'The :attribute field must not be greater than :max kilobytes.',
154+
// 'numeric' => 'The :attribute field must not be greater than :max.',
155+
// 'string' => 'The :attribute field must not be greater than :max characters.',
156+
// ],
157+
// 'max_digits' => 'The :attribute field must not have more than :max digits.',
158+
// 'mimes' => 'The :attribute field must be a file of type: :values.',
159+
// 'mimetypes' => 'The :attribute field must be a file of type: :values.',
160+
// 'min' => [
161+
// 'array' => 'The :attribute field must have at least :min items.',
162+
// 'file' => 'The :attribute field must be at least :min kilobytes.',
163+
// 'numeric' => 'The :attribute field must be at least :min.',
164+
// 'string' => 'The :attribute field must be at least :min characters.',
165+
// ],
166+
// 'min_digits' => 'The :attribute field must have at least :min digits.',
167+
// 'missing' => 'The :attribute field must be missing.',
168+
// 'missing_if' => 'The :attribute field must be missing when :other is :value.',
169+
// 'missing_unless' => 'The :attribute field must be missing unless :other is :value.',
170+
// 'missing_with' => 'The :attribute field must be missing when :values is present.',
171+
// 'missing_with_all' => 'The :attribute field must be missing when :values are present.',
172+
// 'multiple_of' => 'The :attribute field must be a multiple of :value.',
173+
// 'not_in' => 'The selected :attribute is invalid.',
174+
// 'not_regex' => 'The :attribute field format is invalid.',
175+
// 'numeric' => 'The :attribute field must be a number.',
176+
// 'password' => [
177+
// 'letters' => 'The :attribute field must contain at least one letter.',
178+
// 'mixed' => 'The :attribute field must contain at least one uppercase and one lowercase letter.',
179+
// 'numbers' => 'The :attribute field must contain at least one number.',
180+
// 'symbols' => 'The :attribute field must contain at least one symbol.',
181+
// 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.',
182+
// ],
183+
// 'present' => 'The :attribute field must be present.',
184+
// 'present_if' => 'The :attribute field must be present when :other is :value.',
185+
// 'present_unless' => 'The :attribute field must be present unless :other is :value.',
186+
// 'present_with' => 'The :attribute field must be present when :values is present.',
187+
// 'present_with_all' => 'The :attribute field must be present when :values are present.',
188+
// 'prohibited' => 'The :attribute field is prohibited.',
189+
// 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
190+
// 'prohibited_if_accepted' => 'The :attribute field is prohibited when :other is accepted.',
191+
// 'prohibited_if_declined' => 'The :attribute field is prohibited when :other is declined.',
192+
// 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
193+
// 'prohibits' => 'The :attribute field prohibits :other from being present.',
194+
// 'regex' => 'The :attribute field format is invalid.',
195+
// 'required' => 'The :attribute field is required.',
196+
// 'required_array_keys' => 'The :attribute field must contain entries for: :values.',
197+
// 'required_if' => 'The :attribute field is required when :other is :value.',
198+
// 'required_if_accepted' => 'The :attribute field is required when :other is accepted.',
199+
// 'required_if_declined' => 'The :attribute field is required when :other is declined.',
200+
// 'required_unless' => 'The :attribute field is required unless :other is in :values.',
201+
// 'required_with' => 'The :attribute field is required when :values is present.',
202+
// 'required_with_all' => 'The :attribute field is required when :values are present.',
203+
// 'required_without' => 'The :attribute field is required when :values is not present.',
204+
// 'required_without_all' => 'The :attribute field is required when none of :values are present.',
205+
// 'same' => 'The :attribute field must match :other.',
206+
// 'size' => [
207+
// 'array' => 'The :attribute field must contain :size items.',
208+
// 'file' => 'The :attribute field must be :size kilobytes.',
209+
// 'numeric' => 'The :attribute field must be :size.',
210+
// 'string' => 'The :attribute field must be :size characters.',
211+
// ],
212+
// 'starts_with' => 'The :attribute field must start with one of the following: :values.',
213+
// 'string' => 'The :attribute field must be a string.',
214+
// 'timezone' => 'The :attribute field must be a valid timezone.',
215+
// 'unique' => 'The :attribute has already been taken.',
216+
// 'uploaded' => 'The :attribute failed to upload.',
217+
// 'uppercase' => 'The :attribute field must be uppercase.',
218+
// 'url' => 'The :attribute field must be a valid URL.',
219+
// 'ulid' => 'The :attribute field must be a valid ULID.',
220+
// 'uuid' => 'The :attribute field must be a valid UUID.',

0 commit comments

Comments
 (0)