kmuenkel / validation-patch
Correct for various issues in Laravel Validation
1.0.2
2020-11-30 16:00 UTC
Requires
- illuminate/validation: ^7.0|^8.0
Requires (Dev)
- barryvdh/laravel-ide-helper: ^2.8
- friendsofphp/php-cs-fixer: ^2.16
- fzaninotto/faker: ^1.9
- mockery/mockery: ^1.4
- orchestra/testbench: ^5.7
- phpmd/phpmd: ^2.9
- phpunit/phpunit: ^9.4
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2025-03-08 02:39:52 UTC
README
For all fixes, simply including ValidationPatch\ValidationPatchServiceProvider
in your app
config will allow them to take effect automatically.
Fixes
- Dots in field names: Laravel offers the ability to escape dots in field names so that they're not mistaken for dot-delimiters for nested arrays. However, this did not apply to field references within in rules such as
required_with
orexclude_unless
. This corrects for that. - Forward slashes in field names: Due to a parsing errors, field names that had forward slashes, such as URI claims, would cause an error. These are now supported.
required
only active if parent exists: If a nested array element carried an incarnation of therequired
rule, it would be executed even if the parent element were optional. With this package, nested requirements only fire if the parent exists.- Custom Rule Message Placeholders: Allow
Illuminate\Contracts\Validation\Rule::message()
output to be respected when aliased viaIlluminate\Support\Facades\Validator::extend()
. Also allow those messages to contain placeholders such as"attribute"
or":input"
.