ArcherZdip /
laravel-identity
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Created by PhpStorm. |
||
| 4 | * User: zhanglingyu |
||
| 5 | * Date: 2019-03-06 |
||
| 6 | * Time: 10:55 |
||
| 7 | */ |
||
| 8 | |||
| 9 | if (!function_exists('identity')) { |
||
| 10 | /** |
||
| 11 | * Get Identity value |
||
| 12 | * |
||
| 13 | * @param int $limit |
||
| 14 | * @return mixed |
||
| 15 | */ |
||
| 16 | function identity($limit = 1) |
||
| 17 | { |
||
| 18 | if ($limit == 1) { |
||
| 19 | return app('identity_faker')->one(); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 20 | } |
||
| 21 | |||
| 22 | return app('identity_faker')->limit($limit)->get(); |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | |||
| 27 | if(!function_exists('identity_verity')) { |
||
| 28 | /** |
||
| 29 | * check chinese id number |
||
| 30 | * |
||
| 31 | * @param null $idNumer |
||
|
0 ignored issues
–
show
|
|||
| 32 | * @return bool |
||
| 33 | */ |
||
| 34 | function identity_verity($idNumer = null) |
||
| 35 | { |
||
| 36 | if (is_null($idNumer)) { |
||
| 37 | return false; |
||
| 38 | } |
||
| 39 | |||
| 40 | return \ArcherZdip\Identity\VerityChineseIDNumber::isValid($idNumer); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 |