Skip to content

Commit

Permalink
Updated documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ash-jc-allen committed Jul 2, 2024
1 parent aa9c894 commit c3b3f05
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
- [Custom Database Connection](#custom-database-connection)
- [Specifying the Key Generator](#specifying-the-key-generator)
- [Specifying the User Agent Parser](#specifying-the-user-agent-parser)
- [Specifying the Allowed URL Schemes](#specifying-the-allowed-url-schemes)
- [Helper Methods](#helper-methods)
- [Visits](#visits)
- [Find by URL Key](#find-by-url-key)
Expand Down Expand Up @@ -632,6 +633,23 @@ To do this, you can define the class to be used in the `short-url.php` config fi

You'll just need to ensure that your custom user agent parser class implements the `AshAllenDesign\ShortURL\Interfaces\UserAgentDriver` interface.

#### Specifying the Allowed URL Schemes

By default, Short URL will allow you to create a shortened URL for any URLs beginning with `http://` or `https://`.

However, you may want to change this list of allowed URL schemes. For example, this may be to restrict the creation to only `https://` URLs. Or, it may be to allow URLs to be created using other schemes such as `mailto://` or even custom schemes for your own applications.

To change the list of allowed URL schemes, you can define the list using the `allowed_url_schemes` field in your `short-url.php` config file like so:

```php
'allowed_url_schemes' => [
'http://',
'https://',
'mailto://',
'myapp://',
],
```

### Helper Methods
#### Visits
The ShortURL model includes a relationship (that you can use just like any other Laravel model relation) for getting the
Expand Down

0 comments on commit c3b3f05

Please sign in to comment.