Download the PHP package fredbradley/laravel-rule-nhs-number without Composer
On this page you can find all versions of the php package fredbradley/laravel-rule-nhs-number. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fredbradley/laravel-rule-nhs-number
More information about fredbradley/laravel-rule-nhs-number
Files in fredbradley/laravel-rule-nhs-number
Package laravel-rule-nhs-number
Short Description A Laravel Validator Rule for checking the validity of a NHS Number
License MIT
Informations about the package laravel-rule-nhs-number
Laravel Rule NHS Number Validator
This is a Custom Laravel Rule for validating an NHS Number.
The NHS Number validation logic is written by Liam and found in a separate package, if you'd like to use it without Laravel's dependencies.
Installation
Install the package using Composer:
Laravel's service provider discover will automatically configure the service provider for you.
Using the Validator
After installation, the validator will be available for use directly in your validation rules.
Within the context of a form controller it would like like this:
Using the Rule Object
NB: This is needed required to use with some form builders like Kris Forms
Added bonus: Generators
Because we're using Liam's original code, I've added in a Generator
helper class. Use this in your projects to generate valid random NHS Numbers:
Contributing
At the moment the package is only available in English - due to the way the error message is displayed. If someone would like to contribute to make it translatable that would be nice of them.
👷 Credits
- Fred Bradley for the Laravel-ication of the validator
- Liam Hammett for the original package
- Peter Fisher for the original class
- All Contributors
♻️ License
The MIT License (MIT). Please see the license file for more information.