承接 fikrimastor/mykad 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

fikrimastor/mykad

最新稳定版本:v1.1.0

Composer 安装命令:

composer require fikrimastor/mykad

包简介

Mykad package is a laravel package, purposely to validate, parse, and format Malaysian Identity Card (MyKad) numbers.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

MyKad is a laravel package, purposely to validate, parse, extract and format Malaysian Identity Card (MyKad) numbers.

Installation

You can install the package via composer:

composer require fikrimastor/mykad

Optionally, you can publish the config file with:

php artisan vendor:publish --tag="mykad-config"

This is the contents of the published config file:

return [
    'states-code' => [
        // Source: https://www.jpn.gov.my/my/kod-negeri

        // Johor
        '01' => 'Johor',
        '21' => 'Johor',
        '22' => 'Johor',
        '23' => 'Johor',
        '24' => 'Johor',

        // Kedah
        '02' => 'Kedah',
        '25' => 'Kedah',
        '26' => 'Kedah',
        '27' => 'Kedah',

        ...
        ...
        ...

        // Negeri Tidak Diketahui
        '82' => 'Unknown',
    ],
];

Usage

use FikriMastor\MyKad\Facades\MyKad;

echo MyKad::sanitize('010101-01-0101'); // '010101010101'

echo MyKad::extract('010101010101'); 
//[
//  "date_of_birth" => "1 January 2001"
//  "state" => "Johor"
//  "gender" => "Male"
//]

You can also use the validator to validate the MyKad number.

use FikriMastor\MyKad\Rules\IsMyKad;
 
$request->validate([
    'mykad' => ['required', 'string', new IsMyKad],
]);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固