matriphe/manekin

针对印度尼西亚数据的Faker扩展器。

1.0.5 2018-07-21 14:20 UTC

This package is auto-updated.

Last update: 2024-09-21 20:23:10 UTC


README

Build Status

Manekin是Faker的扩展器,专门针对印度尼西亚数据。它仅生成针对印度尼西亚的假数据。

安装

使用composer,运行此命令。

composer require matriphe/manekin

Laravel 5集成

打开config/app.php并在providers部分添加此行。

Matriphe\Manekin\ManekinServiceProvider::class,

现在你的模型工厂应该加载Manekin

Laravel 5.5包自动发现

此包支持Laravel 5.5包自动发现功能。您不需要在config/app.php中手动添加。

Lumen集成

打开bootstrap/app.php并在Register Service Providers部分添加此行。

$app->register(Matriphe\Manekin\ManekinServiceProvider::class);

用法

Manekin的方法与Faker的方法相同。它只是扩展了方法。

特定格式化程序

Matriphe\Manekin\Providers\Address

返回印度尼西亚领土内的坐标。

latitude($min = -10.1718, $max = 5.88969)     // -6.21462
longitude($min = 95.31644, $max = 140.71813)  // 106.84513
localCoordinates()                            // array('latitude' => -6.21462, 'longitude' => 106.84513)

Matriphe\Manekin\Providers\DateTime

返回出生日期。

birthDate($minAge = 13, $maxAge = 100, $timezone = null)    // DateTime('1984-03-22 20:38:00', 'Asia/Jakarta')

Matriphe\Manekin\Providers\Device

返回IMEI、IMSI、ICCID和Android设备ID。

imei()                  // 8658507594263070
imsi()                  // 510079932515821
iccid()                 // 8962097349284530254C
androidDeviceId()       // 3A73C5C7FB3629D1

Matriphe\Manekin\Providers\Identity

返回NIK(Nomor Induk Kependudukan)、SIM(Surat Izin Mengemudi)和护照号码。

nik($gender = null)     // 3313402203841234
sim()                   // 849322123456
passport()              // A1234567

Matriphe\Manekin\Providers\Miscellaneous

返回随机字母数字。

randomAlphaNumeric($length = null)     // QS9F8JAR25SF

Matriphe\Manekin\Providers\PhoneNumber

返回印度尼西亚运营商(Telkomsel、Indosat Ooredoo、XL Axiata、Axis、Tri和Smartfren)识别的移动电话号码。

mobilePhoneNumber()         // 0896 0411 6056
e164MobilePhoneNumber()     // +6289604116056

Matriphe\Manekin\Providers\Vehicle

返回警察编号信息。

policeNumber()         // AD 6742 XY
specialPoliceNumber()  // RI 1

许可证

Manekin是在MIT许可证下发布的。