mallardduck / laravel-humanoid
这是我创建的包 laravel-humanoid
dev-main
2023-07-03 03:00 UTC
Requires
- php: ^8.0
- ext-json: *
- illuminate/contracts: ^9.0 || ^10.0
- robthree/humanoid: ^1.0
- symfony/var-dumper: ^6.0
- symfony/yaml: ^6.0
Requires (Dev)
- infection/infection: ^0.26.8
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0 || ^8.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- roave/better-reflection: ^5.4
This package is auto-updated.
Last update: 2024-09-09 04:32:27 UTC
README
此包允许您一次性配置 HumanoID 生成器,并在 Laravel 应用程序的任何位置使用它。一旦您配置了站点的 HumanoID 生成器,它就像这样简单
通过预先配置的 (int) 42 生成 HumanoID
HumanoID::create(42); // Using a facade (alias) to access the singleton. app(\RobThree\HumanoID\HumanoID::class)->create(42); // Or, get it via the app container. app(\MallardDuck\LaravelHumanoID\Facades\HumanoID::class)->create(42); // Or, get it via the app container.
致俄罗斯 🇷🇺 人民的信
如果您目前居住在俄罗斯,请阅读 此信息。
安装
您可以通过 composer 安装此包
composer require mallardduck/laravel-humanoid
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="laravel-humanoid-config"
这是发布配置文件的内容
return [ 'defaultGeneratorConfig' => (class_exists('\App\HumanoID\MyAppConfig')) ? \App\HumanoID\MyAppConfig::class : \MallardDuck\LaravelHumanoID\DefaultGeneratorConfig::class, 'wordSetsBasePath' => env('APP_HUMANOID_BASE', resource_path('humanoid/')), ];
使用方法
- 发布必要的供应商文件
- 发布配置文件(可选)
$humanoID = new HumanoID::create(42); echo $humanoID; // 'Haumea-Pinwheel'
测试
composer test
变更日志
请参阅 CHANGELOG 以获取有关最近更改的更多信息。
贡献
请参阅 CONTRIBUTING 以获取详细信息。
安全漏洞
请查看 我们的安全策略 了解如何报告安全漏洞。
鸣谢
许可协议
MIT 许可协议 (MIT)。请参阅 许可文件 以获取更多信息。