Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk committed Mar 6, 2024
1 parent 25dde40 commit 358c0f7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You can publish the config file with:
php artisan vendor:publish --tag="human-keys-config"
```

If you are using the `KsuidGenerator`, you will need to install the `tuupola/ksuid` package:
If you are using the `KsuidGenerator` (which is the default), you will need to install the `tuupola/ksuid` package:

```bash
composer require tuupola/ksuid
Expand Down Expand Up @@ -80,6 +80,16 @@ This generator will generate something like this: `pos_451734027389370636`.
composer require godruoyi/php-snowflake
```

#### UuidGenerator

As of `v1.1.0`, you can use the `UuidGenerator`, which generates ids using Laravel's `Str::uuid()` helper. Ids generated with this generator will look like: `pos_b8a34e34553a41b885ae218ae81abd42`. The only requirement for this generator is to register it in the config file; there are no external dependencies that are required for it.

```php
// config/human-keys.php

'generator' => \Rawilk\HumanKeys\Generators\UuidGenerator::class,
```

#### Custom Generator

You may define your own generator by implementing the `Rawilk\HumanKeys\Contracts\KeyGenerator` contract. From the generator, you may return an ID based on your application's requirements.
Expand Down

0 comments on commit 358c0f7

Please sign in to comment.