Skip to content

Bulk improvements, bug fixes

Compare
Choose a tag to compare
@bgultekin bgultekin released this 09 Jan 07:44
· 10 commits to master since this release
c8e66ec
  • Remove needless .gitkeep files
  • Change .gitignore file to allow using phpStorm to develop this package
  • Use Closure route instead of the RuleController class to make Route become extendable with extend() method
  • Use ServiceProvider::mergeConfigFrom method to load package configuration instead of loading config file manually
  • Import jQuery validation additional methods to asset JS file
  • Pass laravel App facade instances (e.g. $app['url'], $app['translator'], $app['encrypter'],...) to converter classes
    to remove Helper class, and we can customize message-method with our custom plugin
  • Fix all minor bugs:
    • Get the raw attribute name not ending with [] like foo[][bar]
    • Get user friendly validation message with friendly attribute name like laravel Validator
    • Using URL::to to correct routing path
    • Instance converter classes correctly with constructor of abstract Converter to use custom plugin
    • Get type of input correctly for numeric and file types
    • Parses laravel validation rule correctly for multi-parameters rules like: between, mimes, unique,...
    • Pass parameters correctly for Route::convert() method to make Route extendable via extend()
    • Validation rule alphanum should be named as alpha_num
    • Add data-msg-accept for validation rule image
    • Fix validation rule integer with data-rule-integer instead of data-rule-number
    • Rule same should be data-rule-equalto=":input[name='other']" instead of "input[name='other']"
    • alpha and alpha_num rules should not allow whitespace to make them compatible with laravel Validator
    • Correct string format for vsprintf() from %1s,%2s to %1$s,%2$s
  • Improvements:
    • Allow custom namespace for custom Converter plugin
    • Allow HTML5 attributes to pass jQuery validation rules such as: required, pattern, maxlength, min
    • Allow HTML5 input types to pass jQuery validation rules like: <input type="url", <input type="email",... instead of attribute data-rule-*="true"
    • Only append validation message attribute data-msg-* when validation rule exists
    • Allow multiple jQuery remote rules such as: unique + active_url
    • Use jQuery validation message format like: The field must be between {0} and {1}., The field must be a date after {0}.,...
      So, we can change data-rule-* value at the client-side via JavaScript
    • No need to override method FormBuilder::checkable() because it call to FormBuilder::input() method
    • Format validation message with custom attributes for other, values parameters, those are used by same, required_with rules
  • Support more laravel validation methods:
    • different, before, after, mimes
    • required_with, required_without
    • active_url
  • Implement unit-tests for this package classes (except ServiceProvider one)
  • Update README document for those new improvements
  • And some more refactors, improvements

by @nthachus