Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d836a7c

Browse files
committed
feature: Laravel-Lang#1278 add support to validation-inline
1 parent ebf69e6 commit d836a7c

File tree

75 files changed

+14806
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+14806
-18
lines changed

script/todo.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,12 @@ private function load(): void
209209
private function getTranslations(string $language, string $directory = __DIR__): array
210210
{
211211
return [
212-
'json' => $this->getJsonContent($language, $directory),
213-
'auth' => $this->getContent($language, $directory, 'auth.php'),
214-
'pagination' => $this->getContent($language, $directory, 'pagination.php'),
215-
'passwords' => $this->getContent($language, $directory, 'passwords.php'),
216-
'validation' => $this->getContent($language, $directory, 'validation.php'),
212+
'json' => $this->getJsonContent($language, $directory),
213+
'auth' => $this->getContent($language, $directory, 'auth.php'),
214+
'pagination' => $this->getContent($language, $directory, 'pagination.php'),
215+
'passwords' => $this->getContent($language, $directory, 'passwords.php'),
216+
'validation' => $this->getContent($language, $directory, 'validation.php'),
217+
'validation-inline' => $this->getContent($language, $directory, 'validation-inline.php'),
217218
];
218219
}
219220

src/ar/validation-inline.php

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Validation Language Lines
8+
|--------------------------------------------------------------------------
9+
|
10+
| The following language lines contain the default error messages used by
11+
| the validator class. Some of these rules have multiple versions such
12+
| as the size rules. Feel free to tweak each of these messages here.
13+
|
14+
*/
15+
16+
'accepted' => 'This field must be accepted.',
17+
'active_url' => 'This is not a valid URL.',
18+
'after' => 'This must be a date after :date.',
19+
'after_or_equal' => 'This must be a date after or equal to :date.',
20+
'alpha' => 'This field may only contain letters.',
21+
'alpha_dash' => 'This field may only contain letters, numbers, dashes and underscores.',
22+
'alpha_num' => 'This field may only contain letters and numbers.',
23+
'array' => 'This field must be an array.',
24+
'before' => 'This must be a date before :date.',
25+
'before_or_equal' => 'This must be a date before or equal to :date.',
26+
'between' => [
27+
'numeric' => 'This value must be between :min and :max.',
28+
'file' => 'This file must be between :min and :max kilobytes.',
29+
'string' => 'This string must be between :min and :max characters.',
30+
'array' => 'This content must have between :min and :max items.',
31+
],
32+
'boolean' => 'This field must be true or false.',
33+
'confirmed' => 'The confirmation does not match.',
34+
'date' => 'This is not a valid date.',
35+
'date_equals' => 'This must be a date equal to :date.',
36+
'date_format' => 'This does not match the format :format.',
37+
'different' => 'This value must be different from :other.',
38+
'digits' => 'This must be :digits digits.',
39+
'digits_between' => 'This must be between :min and :max digits.',
40+
'dimensions' => 'This image has invalid dimensions.',
41+
'distinct' => 'This field has a duplicate value.',
42+
'email' => 'This must be a valid email address.',
43+
'ends_with' => 'This must end with one of the following: :values.',
44+
'exists' => 'The selected value is invalid.',
45+
'file' => 'The content must be a file.',
46+
'filled' => 'This field must have a value.',
47+
'gt' => [
48+
'numeric' => 'The value must be greater than :value.',
49+
'file' => 'The file size must be greater than :value kilobytes.',
50+
'string' => 'The string must be greater than :value characters.',
51+
'array' => 'The content must have more than :value items.',
52+
],
53+
'gte' => [
54+
'numeric' => 'The value must be greater than or equal :value.',
55+
'file' => 'The file size must be greater than or equal :value kilobytes.',
56+
'string' => 'The string must be greater than or equal :value characters.',
57+
'array' => 'The content must have :value items or more.',
58+
],
59+
'image' => 'This must be an image.',
60+
'in' => 'The selected value is invalid.',
61+
'in_array' => 'This value does not exist in :other.',
62+
'integer' => 'This must be an integer.',
63+
'ip' => 'This must be a valid IP address.',
64+
'ipv4' => 'This must be a valid IPv4 address.',
65+
'ipv6' => 'This must be a valid IPv6 address.',
66+
'json' => 'This must be a valid JSON string.',
67+
'lt' => [
68+
'numeric' => 'The value must be less than :value.',
69+
'file' => 'The file size must be less than :value kilobytes.',
70+
'string' => 'The string must be less than :value characters.',
71+
'array' => 'The content must have less than :value items.',
72+
],
73+
'lte' => [
74+
'numeric' => 'The value must be less than or equal :value.',
75+
'file' => 'The file size must be less than or equal :value kilobytes.',
76+
'string' => 'The string must be less than or equal :value characters.',
77+
'array' => 'The content must not have more than :value items.',
78+
],
79+
'max' => [
80+
'numeric' => 'The value may not be greater than :max.',
81+
'file' => 'The file size may not be greater than :max kilobytes.',
82+
'string' => 'The string may not be greater than :max characters.',
83+
'array' => 'The content may not have more than :max items.',
84+
],
85+
'mimes' => 'This must be a file of type: :values.',
86+
'mimetypes' => 'This must be a file of type: :values.',
87+
'min' => [
88+
'numeric' => 'The value must be at least :min.',
89+
'file' => 'The file size must be at least :min kilobytes.',
90+
'string' => 'The string must be at least :min characters.',
91+
'array' => 'The value must have at least :min items.',
92+
],
93+
'not_in' => 'The selected value is invalid.',
94+
'not_regex' => 'This format is invalid.',
95+
'numeric' => 'This must be a number.',
96+
'password' => 'The password is incorrect.',
97+
'present' => 'This field must be present.',
98+
'regex' => 'This format is invalid.',
99+
'required' => 'This field is required.',
100+
'required_if' => 'This field is required when :other is :value.',
101+
'required_unless' => 'This field is required unless :other is in :values.',
102+
'required_with' => 'This field is required when :values is present.',
103+
'required_with_all' => 'This field is required when :values are present.',
104+
'required_without' => 'This field is required when :values is not present.',
105+
'required_without_all' => 'This field is required when none of :values are present.',
106+
'same' => 'The value of this field must match the one from :other.',
107+
'size' => [
108+
'numeric' => 'The value must be :size.',
109+
'file' => 'The file size must be :size kilobytes.',
110+
'string' => 'The string must be :size characters.',
111+
'array' => 'The content must contain :size items.',
112+
],
113+
'starts_with' => 'This must start with one of the following: :values.',
114+
'string' => 'This must be a string.',
115+
'timezone' => 'This must be a valid zone.',
116+
'unique' => 'This has already been taken.',
117+
'uploaded' => 'This failed to upload.',
118+
'url' => 'This format is invalid.',
119+
'uuid' => 'This must be a valid UUID.',
120+
121+
/*
122+
|--------------------------------------------------------------------------
123+
| Custom Validation Language Lines
124+
|--------------------------------------------------------------------------
125+
|
126+
| Here you may specify custom validation messages for attributes using the
127+
| convention "attribute.rule" to name the lines. This makes it quick to
128+
| specify a specific custom language line for a given attribute rule.
129+
|
130+
*/
131+
132+
'custom' => [
133+
'attribute-name' => [
134+
'rule-name' => 'custom-message',
135+
],
136+
],
137+
138+
];

src/az/validation-inline.php

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Validation Language Lines
8+
|--------------------------------------------------------------------------
9+
|
10+
| The following language lines contain the default error messages used by
11+
| the validator class. Some of these rules have multiple versions such
12+
| as the size rules. Feel free to tweak each of these messages here.
13+
|
14+
*/
15+
16+
'accepted' => 'This field must be accepted.',
17+
'active_url' => 'This is not a valid URL.',
18+
'after' => 'This must be a date after :date.',
19+
'after_or_equal' => 'This must be a date after or equal to :date.',
20+
'alpha' => 'This field may only contain letters.',
21+
'alpha_dash' => 'This field may only contain letters, numbers, dashes and underscores.',
22+
'alpha_num' => 'This field may only contain letters and numbers.',
23+
'array' => 'This field must be an array.',
24+
'before' => 'This must be a date before :date.',
25+
'before_or_equal' => 'This must be a date before or equal to :date.',
26+
'between' => [
27+
'numeric' => 'This value must be between :min and :max.',
28+
'file' => 'This file must be between :min and :max kilobytes.',
29+
'string' => 'This string must be between :min and :max characters.',
30+
'array' => 'This content must have between :min and :max items.',
31+
],
32+
'boolean' => 'This field must be true or false.',
33+
'confirmed' => 'The confirmation does not match.',
34+
'date' => 'This is not a valid date.',
35+
'date_equals' => 'This must be a date equal to :date.',
36+
'date_format' => 'This does not match the format :format.',
37+
'different' => 'This value must be different from :other.',
38+
'digits' => 'This must be :digits digits.',
39+
'digits_between' => 'This must be between :min and :max digits.',
40+
'dimensions' => 'This image has invalid dimensions.',
41+
'distinct' => 'This field has a duplicate value.',
42+
'email' => 'This must be a valid email address.',
43+
'ends_with' => 'This must end with one of the following: :values.',
44+
'exists' => 'The selected value is invalid.',
45+
'file' => 'The content must be a file.',
46+
'filled' => 'This field must have a value.',
47+
'gt' => [
48+
'numeric' => 'The value must be greater than :value.',
49+
'file' => 'The file size must be greater than :value kilobytes.',
50+
'string' => 'The string must be greater than :value characters.',
51+
'array' => 'The content must have more than :value items.',
52+
],
53+
'gte' => [
54+
'numeric' => 'The value must be greater than or equal :value.',
55+
'file' => 'The file size must be greater than or equal :value kilobytes.',
56+
'string' => 'The string must be greater than or equal :value characters.',
57+
'array' => 'The content must have :value items or more.',
58+
],
59+
'image' => 'This must be an image.',
60+
'in' => 'The selected value is invalid.',
61+
'in_array' => 'This value does not exist in :other.',
62+
'integer' => 'This must be an integer.',
63+
'ip' => 'This must be a valid IP address.',
64+
'ipv4' => 'This must be a valid IPv4 address.',
65+
'ipv6' => 'This must be a valid IPv6 address.',
66+
'json' => 'This must be a valid JSON string.',
67+
'lt' => [
68+
'numeric' => 'The value must be less than :value.',
69+
'file' => 'The file size must be less than :value kilobytes.',
70+
'string' => 'The string must be less than :value characters.',
71+
'array' => 'The content must have less than :value items.',
72+
],
73+
'lte' => [
74+
'numeric' => 'The value must be less than or equal :value.',
75+
'file' => 'The file size must be less than or equal :value kilobytes.',
76+
'string' => 'The string must be less than or equal :value characters.',
77+
'array' => 'The content must not have more than :value items.',
78+
],
79+
'max' => [
80+
'numeric' => 'The value may not be greater than :max.',
81+
'file' => 'The file size may not be greater than :max kilobytes.',
82+
'string' => 'The string may not be greater than :max characters.',
83+
'array' => 'The content may not have more than :max items.',
84+
],
85+
'mimes' => 'This must be a file of type: :values.',
86+
'mimetypes' => 'This must be a file of type: :values.',
87+
'min' => [
88+
'numeric' => 'The value must be at least :min.',
89+
'file' => 'The file size must be at least :min kilobytes.',
90+
'string' => 'The string must be at least :min characters.',
91+
'array' => 'The value must have at least :min items.',
92+
],
93+
'not_in' => 'The selected value is invalid.',
94+
'not_regex' => 'This format is invalid.',
95+
'numeric' => 'This must be a number.',
96+
'password' => 'The password is incorrect.',
97+
'present' => 'This field must be present.',
98+
'regex' => 'This format is invalid.',
99+
'required' => 'This field is required.',
100+
'required_if' => 'This field is required when :other is :value.',
101+
'required_unless' => 'This field is required unless :other is in :values.',
102+
'required_with' => 'This field is required when :values is present.',
103+
'required_with_all' => 'This field is required when :values are present.',
104+
'required_without' => 'This field is required when :values is not present.',
105+
'required_without_all' => 'This field is required when none of :values are present.',
106+
'same' => 'The value of this field must match the one from :other.',
107+
'size' => [
108+
'numeric' => 'The value must be :size.',
109+
'file' => 'The file size must be :size kilobytes.',
110+
'string' => 'The string must be :size characters.',
111+
'array' => 'The content must contain :size items.',
112+
],
113+
'starts_with' => 'This must start with one of the following: :values.',
114+
'string' => 'This must be a string.',
115+
'timezone' => 'This must be a valid zone.',
116+
'unique' => 'This has already been taken.',
117+
'uploaded' => 'This failed to upload.',
118+
'url' => 'This format is invalid.',
119+
'uuid' => 'This must be a valid UUID.',
120+
121+
/*
122+
|--------------------------------------------------------------------------
123+
| Custom Validation Language Lines
124+
|--------------------------------------------------------------------------
125+
|
126+
| Here you may specify custom validation messages for attributes using the
127+
| convention "attribute.rule" to name the lines. This makes it quick to
128+
| specify a specific custom language line for a given attribute rule.
129+
|
130+
*/
131+
132+
'custom' => [
133+
'attribute-name' => [
134+
'rule-name' => 'custom-message',
135+
],
136+
],
137+
138+
];

0 commit comments

Comments
 (0)