PHPackages                             worawitj/validation - 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. worawitj/validation

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

worawitj/validation
===================

A Laravel for validating Thai ID Card

1.0.3(4y ago)030MITPHPPHP ^8.0

Since Jul 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/testanley/worawitj-validate)[ Packagist](https://packagist.org/packages/worawitj/validation)[ RSS](/packages/worawitj-validation/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (5)Used By (0)

worawitj-idcard-validate
========================

[](#worawitj-idcard-validate)

Thai-idcard-validate

 🔒 Thai ID Card Laravel Validation
========================================================================

[](#--thai-id-card-laravel-validation)

แพคเกจนี้พัฒนามาจาก phattarachai/thai-id-card-validation เพื่อใช้ในการทำ Project ต่อยอด Validation Rule สำหรับตรวจสอบความถูกต้องรหัสบัตรประชาชน สามารถใช้ได้ทั้งในใน Laravel และ PHP Project.

 ติดตั้ง
==============================================

[](#-ติดตั้ง)

```
composer require worawitj/validation

```

 การใช้งาน
=========================================

[](#-การใช้งาน)

เรียกใช้ class ThaiIdCardRule ใน field ที่ต้องการ validate

```
use Worawitj\Validation\ThaiIdCardRule;

// ใน controller
$this->validate($request, [
    'email' => 'required',
    'id_card_no' => new ThaiIdCardRule,
    // ...
]);
```

 Validation Message
==================================================

[](#-validation-message)

ถ้า validate ไม่ผ่านจะแสดงข้อความ `Please Check Your IdCard` เป็นค่าเริ่มต้ม ถ้าต้องการแก้ไข message สามารถ override class เพื่อแก้ message ได้

```
use Worawitj\Validation\ThaiIdCardRule;

// ใน controller
$validator = Validator::make($request_data, ['id_card' => 'required|string|new ThaiIdCardRule('IdCard is not Valid',$request)']);
```

```
use Worawitj\Validation\ThaiIdCardRule as Rule;

class NewThaiIdCardRule extends Rule
{
    /**
     * Get the validation error message.
     *
     * @return string
     */
     public function message()
    {

        return $this->message?:"Please Check Your IdCard";
    }
}
```

การใช้งานใน PHP (นอก Laravel Project)
=====================================

[](#การใช้งานใน-php-นอก-laravel-project)

ถ้าต้องการตรวจสอบรหัสบัตรประชาชนใน PHP หรือ Framework อื่น ๆ ที่ไม่ใช่ Laravel สามารถทำได้ผ่าน class ThaiIdCard

```
use WorawitjIdcardValidate\ThaiIdCardValidation\NewThaiIdCardRule;

$result = (new NewThaiIdCard)->validate('1085217077105');
// true

$result = (new NewThaiIdCard)->validate('1234567890123');
// false
```

License
-------

[](#license)

The MIT License (MIT)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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

Every ~34 days

Total

4

Last Release

1724d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1861957?v=4)[testanley](/maintainers/testanley)[@testanley](https://github.com/testanley)

---

Top Contributors

[![worawitj](https://avatars.githubusercontent.com/u/47169214?v=4)](https://github.com/worawitj "worawitj (12 commits)")[![testanley](https://avatars.githubusercontent.com/u/1861957?v=4)](https://github.com/testanley "testanley (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/worawitj-validation/health.svg)

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

PHPackages © 2026

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