Laravel Classroom image

CiliSp
 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9|Last
Lessons:-Handling Input

8.3 Validation Rules
Here is a list of validation rules, and their purpose.
required
Ensure that a value for a field is present, and is not an empty string.
alpha
The string must only consist of letters (alphabetical characters).
alpha_num
The string must only contain letters and numbers. Useful for usernames.
alpha_dash
The string must contain only letters, numbers, dashes or underscore characters. Useful for
storing URL slugs.
size:5
(string) The string must be exactly five characters long. (numeric) The value must be five.
between:5,10
(string) The length of the string must be between five and ten characters. (numeric) The value
must be between five and ten.
min:5
(string) The length of the string must be between five characters or more. (numeric) The value
must be equal to or greater than five. (file) The file size must be 5 kilobytes or more.
max:5
(string) The length of the string must be less than or equal to five. (numeric) The value must be
less than or equal to five. (file) The file size must be 5 kilobytes or less.
numeric
The value must be numeric.
integer
The value must be an integer or whole number.
in:red,green,blue
Ensure that the value is contained within the list of values provided.
not_in:pink,purple
Ensure that none of the values provided match the value.
confirmed
The value of the field must match a confirmation field, named in the format ‘
acceptedThe field value must be equal to ‘yes’ or 1. Useful for validating check-boxes.
same:age
The field value must match the field specified by the same rule.
different:age
The field value must not match the field specified by the same rule.
match:/[a-z]+/
The field value must match the provided regular expression.
unique:users
This is one of my favourites. The validator will look at the users database table, and make sure
that the value is unique within the column that has the same name as the field name. Useful for
making sure that duplicate usernames or email addresses don’t occur.
If you would like to specify an alternate column name, simply pass it as a second parameter..
1 unique:users,nickname
You can also force the rule to ignore a provided id by passing it as a third parameter.
1 unique:users,nickname,5
exists:colors
Acts as the opposite of unique, the value must already exist in the database table. Once more
you can pass a second parameter to refer to another column.
before:1984-12-12
The date provided by the field, must have occurred before the date template provided to the
before rule.
The before and after filters use strtotime() to calculate a timestamp for comparison, this means
you can do some neat tricks like..
1 before:next Thursday
Unfortunately I was on the one that added this functionality, so if it breaks you can go ahead
and shout at me… sorry!
after:1984-12-12
Similar to before, only the date must occur after the date provided to the after rule.
email
The value must be a valid email address.
url
Validation 39
The value must match the format of an URL.
active_url
The value must match a valid active URL. checkdnsr is used to verify that the URL is active.
mimes:png,mp3
The value must be a $_FILE which whose MIME type matches the file extensions provided. You
can add additional MIME types to the array in config/mimes.php.
image
The uploaded file must be an image.

 

 
 
 

CiliSp

Skills    Laravel

Qualifications :-
Location :-,,,
Description:-
Explore
 

  Students (0)