PHPackages                             tailflow/laravel-human-readable-keys - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tailflow/laravel-human-readable-keys

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tailflow/laravel-human-readable-keys
====================================

Generate Stripe-like IDs for Eloquent models

1.0(5y ago)71.7k↑96.4%MITPHPPHP &gt;=7.2

Since Feb 4Pushed 3y ago2 watchersCompare

[ Source](https://github.com/tailflow/laravel-human-readable-keys)[ Packagist](https://packagist.org/packages/tailflow/laravel-human-readable-keys)[ Docs](https://github.com/tailflow/laravel-human-readable-keys)[ RSS](/packages/tailflow-laravel-human-readable-keys/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Laravel Human Readable Keys
===========================

[](#laravel-human-readable-keys)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1963cf392d1ee70d7412c4e818fd5ee3d2393455a1b369f0a3e0dde320f7ebc6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7461696c666c6f772f6c61726176656c2d68756d616e2d7265616461626c652d6b6579732e737667)](https://packagist.org/packages/tailflow/laravel-human-readable-keys)[![Build Status on Github Actions](https://camo.githubusercontent.com/4dea9c48175a624d9c0621106dfb7d308e15ff3d5ed5f5a9456be7013d03a7a2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7461696c666c6f772f6c61726176656c2d68756d616e2d7265616461626c652d6b6579732f63692e796d6c3f6272616e63683d6d61696e)](https://github.com/tailflow/laravel-human-readable-keys/actions)

Have you ever wanted to generate Stripe-like IDs for your Eloquent models? This package does exactly that!

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tailflow/laravel-human-readable-keys
```

Usage
-----

[](#usage)

1. Change type of the `id` (or whatever your primary key column is) to `string` in the migration

```
Schema::create('users', function (Blueprint $table) {
    $table->string('id');

    ...
});
```

2. Add `HasHumanReadableKey` trait to a model

```
