https://github.com/tailflow/laravel-human-readable-keys
Generate Stripe-like IDs for Eloquent models
https://github.com/tailflow/laravel-human-readable-keys
Last synced: 2 months ago
JSON representation
Generate Stripe-like IDs for Eloquent models
- Host: GitHub
- URL: https://github.com/tailflow/laravel-human-readable-keys
- Owner: tailflow
- License: mit
- Created: 2021-02-04T07:12:19.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-19T16:09:45.000Z (over 2 years ago)
- Last Synced: 2024-09-22T19:36:45.476Z (9 months ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel Human Readable Keys
[](https://packagist.org/packages/tailflow/laravel-human-readable-keys)
[](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
You can install the package via composer:
```bash
composer require tailflow/laravel-human-readable-keys
```## Usage
1. Change type of the `id` (or whatever your primary key column is) to `string` in the migration
```php
Schema::create('users', function (Blueprint $table) {
$table->string('id');
...
});
```2. Add `HasHumanReadableKey` trait to a model
```php