https://github.com/mallardduck/laravel-humanoid
Use HumanoID in Laravel with Ease!
https://github.com/mallardduck/laravel-humanoid
human-id humanoid int-to-string-uid laravel laravel-package zoo-ids
Last synced: 6 months ago
JSON representation
Use HumanoID in Laravel with Ease!
- Host: GitHub
- URL: https://github.com/mallardduck/laravel-humanoid
- Owner: mallardduck
- License: mit
- Created: 2022-04-24T20:20:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-21T01:12:45.000Z (10 months ago)
- Last Synced: 2025-03-25T17:46:53.006Z (7 months ago)
- Topics: human-id, humanoid, int-to-string-uid, laravel, laravel-package, zoo-ids
- Language: PHP
- Homepage:
- Size: 68.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Use [HumanoID](https://github.com/RobThree/HumanoID) in Laravel with Ease!
[](https://packagist.org/packages/mallardduck/laravel-humanoid)
[](https://github.com/mallardduck/laravel-humanoid/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/mallardduck/laravel-humanoid/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[](https://packagist.org/packages/mallardduck/laravel-humanoid)This package allows you to configure a [HumanoID](https://github.com/RobThree/HumanoID) generator once and use it anywhere in your Laravel application.
Once you've configured your site/apps [HumanoID](https://github.com/RobThree/HumanoID) generator it's as easy as:> Generates a HumanoID via your preconfigured for (int) 42
```php
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](./ToRussianPeople.md).
## Installation
You can install the package via composer:
```bash
composer require mallardduck/laravel-humanoid
```You can publish the config file with:
```bash
php artisan vendor:publish --tag="laravel-humanoid-config"
```This is the contents of the published config file:
```php
return [
'defaultGeneratorConfig' => (class_exists('\App\HumanoID\MyAppConfig')) ? \App\HumanoID\MyAppConfig::class : \MallardDuck\LaravelHumanoID\DefaultGeneratorConfig::class,
'wordSetsBasePath' => env('APP_HUMANOID_BASE', resource_path('humanoid/')),
];
```## Usage
1. Publish the necessary vendor files,
2. Publish the config files (optional),```php
$humanoID = new HumanoID::create(42);
echo $humanoID; // 'Haumea-Pinwheel'
```## Testing
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Dan Pock](https://github.com/MallardDuck)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.