Use HumanoID in Laravel with Ease!
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.
If you currently live in Russia, please read this message.
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/')),
];
- Publish the necessary vendor files,
- Publish the config files (optional),
$humanoID = new HumanoID::create(42);
echo $humanoID; // 'Haumea-Pinwheel'
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.