Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
4f560fdf
Commit
4f560fdf
authored
Oct 16, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
continuing to refactor the validator.
parent
6f366d30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
35 deletions
+35
-35
validation.php
laravel/language/en/validation.php
+28
-23
validator.php
laravel/validation/validator.php
+7
-12
No files found.
laravel/language/en/validation.php
View file @
4f560fdf
...
...
@@ -2,28 +2,33 @@
return
array
(
"accepted"
=>
"The :attribute must be accepted."
,
"active_url"
=>
"The :attribute is not a valid URL."
,
"alpha"
=>
"The :attribute may only contain letters."
,
"alpha_dash"
=>
"The :attribute may only contain letters, numbers, and dashes."
,
"alpha_num"
=>
"The :attribute may only contain letters and numbers."
,
"between"
=>
"The :attribute must be between :min - :max."
,
"confirmed"
=>
"The :attribute confirmation does not match."
,
"email"
=>
"The :attribute format is invalid."
,
"image"
=>
"The :attribute must be an image."
,
"in"
=>
"The selected :attribute is invalid."
,
"integer"
=>
"The :attribute must be an integer."
,
"max"
=>
"The :attribute must be less than :max."
,
"mimes"
=>
"The :attribute must be a file of type: :values."
,
"min"
=>
"The :attribute must be at least :min."
,
"not_in"
=>
"The selected :attribute is invalid."
,
"numeric"
=>
"The :attribute must be a number."
,
"required"
=>
"The :attribute field is required."
,
"size"
=>
"The :attribute must be :size."
,
"unique"
=>
"The :attribute has already been taken."
,
"url"
=>
"The :attribute format is invalid."
,
"characters"
=>
"characters"
,
"kilobytes"
=>
"kilobytes"
,
"accepted"
=>
"The :attribute must be accepted."
,
"active_url"
=>
"The :attribute is not a valid URL."
,
"alpha"
=>
"The :attribute may only contain letters."
,
"alpha_dash"
=>
"The :attribute may only contain letters, numbers, and dashes."
,
"alpha_num"
=>
"The :attribute may only contain letters and numbers."
,
"between"
=>
"The :attribute must be between :min - :max."
,
"between.file"
=>
"The :attribute must be between :min - :max kilobytes."
,
"between.string"
=>
"The :attribute must be between :min - :max characters."
,
"confirmed"
=>
"The :attribute confirmation does not match."
,
"email"
=>
"The :attribute format is invalid."
,
"image"
=>
"The :attribute must be an image."
,
"in"
=>
"The selected :attribute is invalid."
,
"integer"
=>
"The :attribute must be an integer."
,
"max"
=>
"The :attribute must be less than :max."
,
"max.file"
=>
"The :attribute must be less than :max kilobytes."
,
"max.string"
=>
"The :attribute must be less than :max characters."
,
"mimes"
=>
"The :attribute must be a file of type: :values."
,
"min"
=>
"The :attribute must be at least :min."
,
"min.file"
=>
"The :attribute must be at least :min kilobytes."
,
"min.string"
=>
"The :attribute must be at least :min characters."
,
"not_in"
=>
"The selected :attribute is invalid."
,
"numeric"
=>
"The :attribute must be a number."
,
"required"
=>
"The :attribute field is required."
,
"size"
=>
"The :attribute must be :size."
,
"size.file"
=>
"The :attribute must be :size kilobyte."
,
"size.string"
=>
"The :attribute must be :size characters."
,
"unique"
=>
"The :attribute has already been taken."
,
"url"
=>
"The :attribute format is invalid."
,
);
\ No newline at end of file
laravel/validation/validator.php
View file @
4f560fdf
...
...
@@ -515,20 +515,15 @@ class Validator {
{
return
$this
->
messages
[
$rule
];
}
elseif
(
in_array
(
$rule
,
$this
->
size_rules
)
and
!
$this
->
has_rule
(
$attribute
,
$this
->
numeric_rules
))
{
$line
=
(
array_key_exists
(
$attribute
,
Input
::
file
()))
?
"file"
:
"string"
;
return
Lang
::
line
(
"validation.
{
$rule
}
.
{
$line
}
"
)
->
get
(
$this
->
language
);
}
else
{
$message
=
Lang
::
line
(
'validation.'
.
$rule
)
->
get
(
$this
->
language
);
// For "size" rules that are validating strings or files, we need to adjust
// the default error message for the appropriate units.
if
(
in_array
(
$rule
,
$this
->
size_rules
)
and
!
$this
->
has_rule
(
$attribute
,
$this
->
numeric_rules
))
{
return
(
array_key_exists
(
$attribute
,
Input
::
file
()))
?
rtrim
(
$message
,
'.'
)
.
' '
.
Lang
::
line
(
'validation.kilobytes'
)
->
get
(
$this
->
language
)
.
'.'
:
rtrim
(
$message
,
'.'
)
.
' '
.
Lang
::
line
(
'validation.characters'
)
->
get
(
$this
->
language
)
.
'.'
;
}
return
$message
;
return
Lang
::
line
(
"validation.
{
$rule
}
"
)
->
get
(
$this
->
language
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment