PHP code example of meditate / twid

1. Go to this page and download the library: Download meditate/twid library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

meditate / twid example snippets


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

use Meditate\IdentityCard\TaiwanIdentityCard;

$taiwanIdCard = new TaiwanIdentityCard;

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

// A123456789
$taiwanIdCard->make();

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

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

Twid::check('A123456789');

Twid::make();

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