PHPackages                             hitobias/twid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. hitobias/twid

ActivePackage[Validation &amp; Sanitization](/categories/validation)

hitobias/twid
=============

Taiwan ID Number validation and maker.

1.0.0(3y ago)026MITPHPPHP ^8.0

Since Mar 20Pushed 3y agoCompare

[ Source](https://github.com/hitobias/twid)[ Packagist](https://packagist.org/packages/hitobias/twid)[ RSS](/packages/hitobias-twid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Taiwan ID Number validation and maker
=====================================

[](#taiwan-id-number-validation-and-maker)

hitobias/twid is PHP Library to validate and make Taiwan ID Number. It supports Php 8.1, 8.2

Contents
--------

[](#contents)

- [Taiwan ID Number validation and maker](#taiwan-id-number-validation-and-maker)
    - [Contents](#contents)
    - [Installation](#installation)
    - [Usage](#usage)
        - [Basic](#basic)
        - [Facade](#facade)
        - [Laravel validation](#laravel-validation)
    - [License](#license)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require meditate/twid
```

If you are Laravel project, add twid facade in `app/config/app.php`:

```
'aliases' => [
	...

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

Usage
-----

[](#usage)

### Basic

[](#basic)

```
use Meditate\IdentityCard\TaiwanIdentityCard;

$taiwanIdCard = new TaiwanIdentityCard;
```

Now, you can use `check` method to validate ID Number:

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

Or generate a fake ID Number:

```
// A123456789
$taiwanIdCard->make();

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

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

### Facade

[](#facade)

Also you can use facade:

```
Twid::check('A123456789');

Twid::make();
```

### Laravel validation

[](#laravel-validation)

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

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

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/thephpleague/skeleton/blob/master/LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1155d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d42ad36f85a65ca4445b5ef5d42bd947c1e66530008214f512c7271d0421f283?d=identicon)[hitobias](/maintainers/hitobias)

---

Top Contributors

[![TenTail](https://avatars.githubusercontent.com/u/16322298?v=4)](https://github.com/TenTail "TenTail (6 commits)")[![goodjack](https://avatars.githubusercontent.com/u/1116129?v=4)](https://github.com/goodjack "goodjack (2 commits)")[![bnc-eric-li](https://avatars.githubusercontent.com/u/203964734?v=4)](https://github.com/bnc-eric-li "bnc-eric-li (1 commits)")[![shengyou](https://avatars.githubusercontent.com/u/1264736?v=4)](https://github.com/shengyou "shengyou (1 commits)")

---

Tags

laravelvalidationTaiwanID numberidentity cardlaravel-dojomeditatehitobias

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/hitobias-twid/health.svg)

```
[![Health](https://phpackages.com/badges/hitobias-twid/health.svg)](https://phpackages.com/packages/hitobias-twid)
```

###  Alternatives

[meditate/twid

Taiwan ID Number validation and maker.

278.3k](/packages/meditate-twid)[schuppo/password-strength

This package provides a validator for ensuring strong passwords in Laravel 4 applications.

1432.7M1](/packages/schuppo-password-strength)[stuyam/laravel-phone-validator

A phone validator for Laravel using the free Twilio phone lookup service.

2861.3k](/packages/stuyam-laravel-phone-validator)[skysplit/laravel5-intl-translation

Laravel 5 package for better translation syntax using php-intl extension

10106.2k](/packages/skysplit-laravel5-intl-translation)[pacerit/laravel-polish-validation-rules

Simple Polish Validation rules for Laravel and Lumen framework

1449.9k](/packages/pacerit-laravel-polish-validation-rules)[laravel-validation-rules/ip

Validate if an ip address is public or private.

1629.7k](/packages/laravel-validation-rules-ip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
