mallardduck / laravel-humanoid
This is my package laravel-humanoid
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-11-09 04:49:46 UTC
README
This package allows you to configure a HumanoID generator once and use it anywhere in your Laravel application. Once you've configured your site/apps HumanoID generator it's as easy as:
Generates a HumanoID via your preconfigured for (int) 42
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.
A message to Russian 🇷🇺 people
If you currently live in Russia, please read this message.
Installation
You can install the package via composer:
composer require mallardduck/laravel-humanoid
You can publish the config file with:
php artisan vendor:publish --tag="laravel-humanoid-config"
This is the contents of the published config file:
return [ 'defaultGeneratorConfig' => (class_exists('\App\HumanoID\MyAppConfig')) ? \App\HumanoID\MyAppConfig::class : \MallardDuck\LaravelHumanoID\DefaultGeneratorConfig::class, 'wordSetsBasePath' => env('APP_HUMANOID_BASE', resource_path('humanoid/')), ];
Usage
- Publish the necessary vendor files,
- Publish the config files (optional),
$humanoID = new HumanoID::create(42); echo $humanoID; // 'Haumea-Pinwheel'
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
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.