项目作者: daandevos

项目描述 :
Validate a Dutch car license plate number using Laravel's validator.
高级语言: PHP
项目地址: git://github.com/daandevos/laravel-dutch-license-number-validation.git
创建时间: 2021-02-17T20:55:01Z
项目社区:https://github.com/daandevos/laravel-dutch-license-number-validation

开源协议:MIT License

下载


Dutch license plate number validation

Scrutinizer Code Quality
Latest Stable Version
Monthly Downloads
License

Using Laravel’s validator.

Requirements

  • PHP >= 7.1
  • Laravel >= 5.5, 6.0, 7.0 or 8.0

Installation

Install the package via Composer:

  1. $ composer require daandevos/laravel-dutch-license-number-validation

Usage

You can use the Dutch license number validation as any other validation rule:

  1. <?php
  2. $request->validate([
  3. 'license_number' => 'required|string|dutch_license_number',
  4. ]);

Optionally you can change the validation error message by adding an entry to the validation language file:

  1. 'dutch_license_number' => 'The Dutch license number format is invalid.',
  2. 'uuid' => 'The :attribute must be a valid UUID.',
  3. // ...

Notice

The allowed input may vary between license plate numbers with and without minus between the numbers or letters. Also, the validation is not case sensitive. To give you an idea of which formats are allowed:

✅ 99-XX-XX
✅ 99XXXX
✅ 99—XX—XX

Before processing the input, you may want to format the license plate number to you own format.

Security Vulnerabilities

If you discover a security vulnerability within this package, please send an e-mail to Daan de Vos via daan@devos.id. All security vulnerabilities will be promptly addressed.

License

This package is open-sourced software licensed under the MIT license.