https://github.com/kmuenkel/validation-patch
Correct for various issues in Laravel Validation
https://github.com/kmuenkel/validation-patch
Last synced: 4 months ago
JSON representation
Correct for various issues in Laravel Validation
- Host: GitHub
- URL: https://github.com/kmuenkel/validation-patch
- Owner: kmuenkel
- License: mit
- Created: 2020-11-30T21:08:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-07T17:14:44.000Z (over 4 years ago)
- Last Synced: 2024-12-23T11:19:49.224Z (5 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Enhanced Validation
For all fixes, simply including `ValidationPatch\ValidationPatchServiceProvider` in your `app` config will allow them to take effect automatically.
### Fixes
1. **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` or `exclude_unless`. This corrects for that.
2. **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.
3. **`required` only active if parent exists**: If a nested array element carried an incarnation of the `required` rule, it would be executed even if the parent element were optional. With this package, nested requirements only fire if the parent exists.
4. **Custom Rule Message Placeholders**: Allow `Illuminate\Contracts\Validation\Rule::message()` output to be respected when aliased via `Illuminate\Support\Facades\Validator::extend()`. Also allow those messages to contain placeholders such as `"attribute"` or `":input"`.