Download the PHP package lemaur/laravel-human-id without Composer
On this page you can find all versions of the php package lemaur/laravel-human-id. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lemaur/laravel-human-id
More information about lemaur/laravel-human-id
Files in lemaur/laravel-human-id
Package laravel-human-id
Short Description Automatically generate Human IDs for your model.
License MIT
Homepage https://github.com/lemaur/laravel-human-id
Informations about the package laravel-human-id
Laravel Human IDs
This package has been inspired by the article "Designing APIs for humans: Object IDs"
appeared on Dev (Aug 30, 2022 / by Paul Asjes).
I really like the approach Stripe uses to define the object ID, so I figured out how to make something similar for Laravel.
Basically, the package generate a so-called "human id" by prepending a prefix to a ULID with a separator between them.
An example should be better than a thousand words...
Support Me
Hey folks,
Do you like this package? Do you find it useful, and it fits well in your project?
I am glad to help you, and I would be so grateful if you considered supporting my work.
You can even choose 😃:
- You can sponsor me 😎 with a monthly subscription.
- You can buy me a coffee ☕ or a pizza 🍕 just for this package.
- You can plant trees 🌴. By using this link we will both receive 30 trees for free and the planet (and me) will thank you.
- You can "Star ⭐" this repository (it's free 😉).
Installation
You can install the package via composer:
Usage
- Add the "human ID" field in your migration files.
- Import the
Lemaur\HumanId\Concerns\HasHuids
trait into your eloquent model.
Here's a real-life example of how to implement the trait on a model.
Configuration
You can use a different name for the field (currently is huid
) and a different separator (currently is _
).
To do that, you should publish the configuration file (config/human-id.php
) and change them from there.
Testing
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
- leMaur
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-human-id with dependencies
spatie/laravel-package-tools Version ^1.14.0
illuminate/contracts Version ^10.0