2017 © Pedro Peláez
 

library identity-card

A simple proof of identity card of the people's Republic of China.

image

ofcold/identity-card

A simple proof of identity card of the people's Republic of China.

  • Tuesday, June 26, 2018
  • by olivia-bill
  • Repository
  • 2 Watchers
  • 82 Stars
  • 175 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 17 Forks
  • 0 Open issues
  • 27 Versions
  • 661 % Grown

The README.md

, (*1)

996.icu LICENSE Total Downloads, (*2)

China (region) citizen ID card tool


, (*3)

Simplified Chinese Documentation , (*4)


China (Mainland) ID card package, the data from the national standard GB/T 2260-2007 (People's Republic of China administrative divisions code standard)., (*5)

Other Language

Installing


composer require ofcold/identity-card

Instructions

A component based on People's Republic of China citizen ID card to obtain the user information.This works for any php framework, but only if the php version is greater than 7.1., (*6)

Useing

Useing in Laravel Validation

Multi-language add Please enter a valid Id Card to your json language package., (*7)


use Ofcold\IdentityCard\Rules\IdCard; /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'id_card' => [ 'required', new IdCard ] ]; }

Verify your Chinese ID card


// Result false OR Ofcold\IdentityCard\IdentityCard instance. $result = Ofcold\IdentityCard\IdentityCard::make('32010619831029081'); if ( $result === false ) { return 'Your ID number is incorrect'; } print_r($result->toArray());

OR test file.

    php test

$idCard = Ofcold\IdentityCard\IdentityCard::make('320106198310290811', 'en'); // Use locale, Current supported zh-cn,en // $idCard = Ofcold\IdentityCard\IdentityCard::make('320106198310290811', 'zh-cn'); if ( $idCard === false ) { return 'Your ID number is incorrect'; } $area = $idCard->getArea(); $gender = $idCard->getGender(); $birthday = $idCard->getBirthday(); $age = $idCard->getAge(); $constellation = $idCard->getConstellation();

Results:

{
    "area": "shan xi sheng yun cheng di qu yun cheng shi",
    "province": "shan xi sheng",
    "city": "yun cheng di qu",
    "county": "yun cheng shi",
    "gender": "Male",
    "birthday": "1980-03-12",
    "zodiac": "Pig",
    "age": 38,
    "constellation": "Pisces"
}

Api

  • getArea() : string Get Area
  • getConstellation() : string Get constellation
  • getZodiac() : string Get zodiac
  • getAge() : int Get age
  • getBirthday(string $foramt = 'Y-m-d') : string Get birthday
  • getGender() : string Get gender
  • getCounty() : string|null Get county
  • getCity() : string|null Get city
  • getProvince() : string|null Get province
  • toArray() : array Get all information.
  • toJson(int $option) : string Json format all information
  • __get() : mixed
  • __toString() : toJson

CHANGELOG

V3.0.0

  • Added Laravel Rule.

V2.0.0

  • Added #2 __get()
  • Added #2 __toString()
  • Modifed #2 static make() Method returns the current object or boolean type
  • Removed #2 Construction method exception verification

The Versions

26/06 2018

2.0.x-dev

2.0.9999999.9999999-dev https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

26/06 2018

2.0.9

2.0.9.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

26/06 2018

dev-master

9999999-dev https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

19/06 2018

2.0.8

2.0.8.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

19/06 2018

dev-old

dev-old https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

28/05 2018

2.0.7

2.0.7.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

28/05 2018

2.0.6

2.0.6.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

27/05 2018

2.0.5

2.0.5.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

27/05 2018

2.0.4

2.0.4.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

26/05 2018

2.0.3

2.0.3.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

26/05 2018

2.0.2

2.0.2.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

25/05 2018

2.0.1

2.0.1.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

25/05 2018

2.0.0

2.0.0.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

id card region area php71

22/04 2018

1.2.x-dev

1.2.9999999.9999999-dev https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

22/04 2018

1.1.17

1.1.17.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

22/04 2018

1.1.16

1.1.16.0 https://ofcold.com

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

28/11 2017

1.1.15

1.1.15.0 https://anomalylab.org

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

26/11 2017

1.1.14

1.1.14.0 https://anomalylab.org

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

20/11 2017

1.1.3

1.1.3.0 https://anomalylab.org

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

20/11 2017

1.1.1

1.1.1.0 https://anomalylab.org

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

20/11 2017

1.1.2

1.1.2.0 https://anomalylab.org

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

20/11 2017

1.1.0

1.1.0.0 https://anomalylab.org

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

20/11 2017

1.0.6

1.0.6.0 https://anomalylab.org

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

19/11 2017

1.0.5

1.0.5.0 https://anomalylab.org

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

19/11 2017

1.0.3

1.0.3.0 https://anomalylab.org

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

19/11 2017

1.0.2

1.0.2.0 https://anomalylab.org

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71

19/11 2017

1.0.1

1.0.1.0 https://anomalylab.org

A simple proof of identity card of the people's Republic of China.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

id card region area php71