Download the PHP package thedavefulton/laravel-exclusive-validation-rules without Composer
On this page you can find all versions of the php package thedavefulton/laravel-exclusive-validation-rules. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thedavefulton/laravel-exclusive-validation-rules
More information about thedavefulton/laravel-exclusive-validation-rules
Files in thedavefulton/laravel-exclusive-validation-rules
Package laravel-exclusive-validation-rules
Short Description Two additional validation rules for use with the Laravel framework
License MIT
Homepage https://github.com/thedavefulton/laravel-exclusive-validation-rules
Informations about the package laravel-exclusive-validation-rules
Rules for ensuring that exactly 1 of n inputs is received
This package was born out of a need to ensure that for a set of inputs exactly 1 was received. Using existing validation rules could ensure that at least 1 or no more than 1 would be received, but there wasn't a succinct way of guaranteeing exactly one.
As such, two rules were implemented. The first, , ensures that exactly 1 of the inputs will be present. The second, , allows for none of the inputs to be present but if any are present there must be exactly 1.
Installation
You can install the package via composer:
The package is configured to use Laravel's automatic discovery. However, you can manually register the service provider in the file:
Usage
These rules may be used like any standard validation rule.
They can also be extended to n inputs
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- David Fulton
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.