2017 © Pedro Peláez
 

library laravel-custom-validator

Laravel 5+ custom validators

image

tartan/laravel-custom-validator

Laravel 5+ custom validators

  • Saturday, May 19, 2018
  • by tartan
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 200 % Grown

The README.md

Laravel 5+ Custom Validators

Installation

composer require "tartan/laravel-custom-validator"

Tartan Custom Validators

Add the required validator(s) to boot method of app/Providers/AppServiceProvider.php, (*1)

Validator::extend('strength', 'Tartan\Validators\CustomValidator@validateStrength');
Validator::extend('iran_billing_id', 'Tartan\Validators\CustomValidator@validateIranBillingId');
Validator::extend('iran_shetab_card', 'Tartan\Validators\CustomValidator@validateShetabCard');
Validator::extend('uuid', 'Tartan\Validators\CustomValidator@validateUuid');
Validator::extend('iran_national_id', 'Tartan\Validators\CustomValidator@validateNationalId');

Add following lines to resources/lang/en/validation.php in Custom Validation Language Lines part, (*2)

'strength' => 'The password :attribute is too weak and must contain one or more uppercase, lowercase, numeric, and special character (!@#$%^&*).',
'iran_billing_id' => 'The billing Id `:attribute` is not a valid Billing Id.',
'shetab_card' => 'The card number `:attribute` is not a valid Shetab card number.',
'uuid' => 'The UUID `:attribute` is not a valid UUID.',
'iran_national_id' => 'The national id `:attribute` is not a valid Iran nationa Id.',

Use like other validator, (*3)

    ...
    'national_id'    => 'required|iran_national_id|unique:users,national_id',
    'password'       => 'required|string|strength|min:6'
    ...

Team

This component is developed by the following person(s) and a bunch of awesome contributors., (*4)

Aboozar Ghaffari
Aboozar Ghaffari

Support This Project

Donate via Paypal, (*5)

License

The Laravel Custom Validator is open-sourced software licensed under the MIT license, (*6)

The Versions

19/05 2018

dev-master

9999999-dev https://github.com/theTartancoder/laravel-custom-validator

Laravel 5+ custom validators

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel component validator package persian iranian

19/05 2018

5.0.0

5.0.0.0 https://github.com/theTartancoder/laravel-custom-validator

Laravel 5+ custom validators

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel component validator package persian iranian