Download the PHP package tailflow/laravel-human-readable-keys without Composer
On this page you can find all versions of the php package tailflow/laravel-human-readable-keys. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tailflow/laravel-human-readable-keys
More information about tailflow/laravel-human-readable-keys
Files in tailflow/laravel-human-readable-keys
Package laravel-human-readable-keys
Short Description Generate Stripe-like IDs for Eloquent models
License MIT
Homepage https://github.com/tailflow/laravel-human-readable-keys
Informations about the package laravel-human-readable-keys
Laravel Human Readable Keys
Have you ever wanted to generate Stripe-like IDs for your Eloquent models? This package does exactly that!
Installation
You can install the package via composer:
Usage
-
Change type of the
id
(or whatever your primary key column is) tostring
in the migration -
Add
HasHumanReadableKey
trait to a model - (Optional) Customize key prefix and length
By default, a singular form of the table name is used as prefix for generated keys. You can customize that by overriding
the getKeyPrefix
method on the model:
Generated keys contain a unique hash that is 24 characters in length. To customize hash length, override the getKeyLength
method:
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-human-readable-keys with dependencies
illuminate/contracts Version >=5.7
illuminate/database Version >=5.7
illuminate/support Version >=5.7