All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Added support costume error message using parameter callback
Validator::messages($pools)
.
- Added
Validator::setErrorMessage
add costume error massage using array paramter.
- Change return type of
__set
tovoid
. - Change
Collection::class
using generic type. - Improve parameter type and return type include parameter callback type.
- Support adding filed using IteratorAggregate interface.
- Update
Wixel/GUMP
to version 2.0.
- Remove
valid_twitter()
validation.
- Add costume validation
valid->valid($closure, $message)
and costume filterfilter->filter($closure)
- Add method
Valid->raw($raw_rule)
to add raw valiation. - Add method __set to add new validation
Validator->__set
and `ValidPool->__set'. - Add method
Filter->raw($raw_rule)
to add raw filter. - Add method __set to add new Filter `ValidPool->__set'.
- Pass third params to add filters rule from method Make
Validator::make($fields, $validPool, $filterPool)
.
- Fixed adding new exist rule not overwrite exist rule.
- Added method
Valid->combine($valid)
andFilter->combine($filter)
to add combine with other rule.
- fixed not exist field method
only
always return true.
- Added method to check form submitted
validator->submitted()
. - Added method to check validaton and form submitted
validator->passed()
. - Added method to check validaton and form submitted
validator->fails()
. - Adding validation from method
Validator::make($field, $closure)
using param$closure
asvalidpool
closuser. - Added method to filter field rule base on field which need to use.
validator->only()
use specified field,validator->except()
inverse of only.
- Add method to add error message using
__set
.
- Fix deprecated warning php 8.0.
- Add filter (rule) condition
where()
, only execute rule filter if condition as true (left side filter). - Add filter (rule) condition
if()
, only execute rule filter if condition as true (right side filter). - Add new filter
filter_
, does't perform anything. This filter also prevent from error when filter rule is empty. - Add static to create new instance
Validator::make()
. - Adding validation rule using callback
Validator->validation($callback)
. - Adding filter rule using callback
Validator->filters($callback)
. - Adding new class (
Validator\Collection::class
) to convert array to smart object. - Adding property to get errors
Validator->erros
and filter outValidation->filters
, it will return asValidator\Collection::class
. - Adding method to costume field error message
Validator::Message()
.
- Change function name from Valid::equals_field() to
Valid::equalsfield()
- Add property
not
same result with methodnot()
. - Add validation (rule) condition
where()
, only execute rule validation if condition as true (left side validation). - Add validation (rule) condition
if()
, only execute rule validation if condition as true (right side validation). - Add new validation
validate_
, check field is contain in input field. This validation also prevent from error when validation rule is empty.
- Fix method
validOrException()
can't throw Exception. - Prevent error when validation rule is empty, by adding new validation
validate_()
.
- Add costume validation error messaage
Rule::set_error_message
andRule::set_error_messages
. - Add method
is_error()
check validataion have error. - Support add multy rule field in single method.
$validation->field('field1', 'field2')
and$validation->filter('field1', 'field2')
. Also work invalidPool::class
andfilterPool::class
- Costume validator does not have an error message. When using method
not()
on validation.
- Add method
lang()
to change language error message.
filter_out()
return merge with fields.
- Add
filter_out(?Closure $rule_filter = null)
param to set filter rule using param. - Add unit test for every method in
validator::class
.
- Fix
get_error()
does't result anything because validate not run yet.
- Change
is_valid
usingRule->validate()
overRule->is_valid()
, because not perform anything for get error.
- Add filter input
- Add filter rule method
noise_words()
,rmpunctuation()
,urlencode()
,sanitize_email()
,sanitize_numbers()
,sanitize_floats()
,sanitize_string()
,boolean()
,basic_tags()
,whole_number()
,ms_word_characters()
,lower_case()
,upper_case()
,slug()
,trim()
,