Skip to content

Commit

Permalink
Merge pull request #189 from ash-jc-allen/doc-updates
Browse files Browse the repository at this point in the history
v7.6.0 doc updates
  • Loading branch information
ash-jc-allen authored Mar 21, 2023
2 parents 3c0653c + 0ad8115 commit dc71eb3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog

**v7.6.0 (released 2023-03-21):**
- Added support for `hashids/hashids` v5.0. [#183](https://github.com/ash-jc-allen/short-url/pull/183)
- Added the ability to pass a seed that can be used when generating the short URL key. [#185](https://github.com/ash-jc-allen/short-url/pull/185)

**v7.5.1 (released 2023-02-01):**
- Added missing date fields to the `casts` array on the models to support Laravel 10. [#181](https://github.com/ash-jc-allen/short-url/pull/181)

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- [Forwarding Query Parameters](#forwarding-query-parameters)
- [Redirect Status Code](#redirect-status-code)
- [Activation and Deactivation Times](#activation-and-deactivation-times)
- [Using a Custom Seed](#using-a-custom-seed)
- [Facade](#facade)
- [Conditionals](#conditionals)
- [Using the Shortened URLs](#using-the-shortened-urls)
Expand Down Expand Up @@ -315,6 +316,18 @@ $shortURLObject = $builder->activateAt(\Carbon\Carbon::now()->addDay())
->make();
```

#### Using a Custom Seed

By default, the package will use the ID of the last inserted short URL as the seed for generating a short URL's key. In some cases, you may want to use a custom seed instead. To do this, you can pass an integer to the `generateUsing` method like so:

```php
$builder = new \AshAllenDesign\ShortURL\Classes\Builder();

$shortURLObject = $builder->destinationUrl('https://destination.com')
->generateUsing(12345)
->make();
```

#### Facade
If you prefer to use facades in Laravel, you can choose to use the provided ``` ShortURL ``` facade instead of instantiating
the ``` Builder ``` class manually.
Expand Down

0 comments on commit dc71eb3

Please sign in to comment.