2017 © Pedro Peláez
 

package twid

Taiwan ID Number validation and maker.

image

meditate/twid

Taiwan ID Number validation and maker.

  • Saturday, July 7, 2018
  • by meditate
  • Repository
  • 5 Watchers
  • 6 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Taiwan ID Number validation and maker

meditate/twid is PHP Library to validate and make Taiwan ID Number., (*1)

Contents

Installation

You can install the package via composer:, (*2)

composer require meditate/twid

If you are Laravel project, add twid facade in app/config/app.php:, (*3)

'aliases' => [
    ...

    'Twid' => Meditate\IdentityCard\Facades\TaiwanIdentityCard::class,
]

Usage

Basic

use Meditate\IdentityCard\TaiwanIdentityCard;

$taiwanIdCard = new TaiwanIdentityCard;

Now, you can use check method to validate ID Number:, (*4)

$taiwanIdCard->check('A123456789'); // true
$taiwanIdCard->check('A223456789'); // false

Or generate a fake ID Number:, (*5)

// A123456789
$taiwanIdCard->make();

// B167663827
$taiwanIdCard->make('B');

// A259776352
$taiwanIdCard->make('A', 2);

Facade

Also you can use facade:, (*6)

Twid::check('A123456789');

Twid::make();

Laravel validation

In Laravel, you can easy use in "form request". Just need to add tw_id rule to the rules method:, (*7)

public function rules()
{
    return [
        'id_number' => 'tw_id'
    ];
}

License

The MIT License (MIT). Please see License File for more information., (*8)

The Versions

07/07 2018

dev-master

9999999-dev

Taiwan ID Number validation and maker.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Wei-Cheng Shi

laravel validation taiwan identity card laravel-dojo meditate id number

07/07 2018

0.1.0

0.1.0.0

Taiwan ID Number validation and maker.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Wei-Cheng Shi

laravel validation taiwan identity card laravel-dojo meditate id number