定制 yasser-elgammal/laravel-egypt-national-id-parser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yasser-elgammal/laravel-egypt-national-id-parser

最新稳定版本:v1.0.0

Composer 安装命令:

composer require yasser-elgammal/laravel-egypt-national-id-parser

包简介

A package to parse egyptian national id number.

README 文档

README

A Laravel package to parse and validate Egyptian National ID numbers, extracting details such as birth date, gender, and governorate.

📌 Features

  • Validate Egyptian National ID numbers
  • Extract birth date, gender, and governorate
  • Supports Arabic and English translations

📦 Installation

Require the package via Composer:

composer require yasser-elgammal/laravel-egypt-national-id-parser

Publish the configuration and translation files:

php artisan vendor:publish --tag=laravel-egypt-national-id-parser-config
php artisan vendor:publish --tag=laravel-egypt-national-id-parser-translations

⚙️ Configuration

The configuration file config/national-id.php allows customization of the package settings, including the default language.

🛠 Usage

Validating an ID Number

use YasserElgammal\LaravelEgyptNationalIdParser\Facades\NationalId;

$idNumber = '00000000000000';
$result = NationalId::validate($idNumber);

You can Also Customize returned lang, default lang is 'english':

$result = NationalId::setLanguage('ar')->validate($idNumber)

Example:

return response()->json([
    'status' => $result['status'],
    'message' => $result['status'] ? 'Valid ID' : 'Invalid ID',
    'data' => $result['data'] ?? null,
    'errors' => $result['errors'] ?? []
]);

📝 License

This package is open-source and licensed under the MIT License.

🙌 Contributions

Contributions are welcome! Feel free to submit a pull request or report issues.

📬 Contact

For any questions, reach out via GitHub Issues or contact me directly.

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-25