NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #2194 most downloaded on Packagist
A Laravel package for creating shortened URLs for your web apps.
Latest stable
v8.5.0
Last release 8 months ago
13 Mar 2026
Ships fairly regularly
a new release about every 2 months
Most releases are documented
notes for 44 of 49 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
49 releases · first in 2019
Drag across the ruler to compare, or tap a release to open it.
Run CI workflows with PHP 8.5 by @erikn69 in https://github.com/ash-jc-allen/short-url/pull/322
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v8.4.1...v8.5.0
Use correct file extension for testbench.yaml in the .gitattributes file by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/321
testbench.yaml in the .gitattributes file by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/321Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v8.4.0...v8.4.1
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Added .gitattributes file by @erikn69 in https://github.com/ash-jc-allen/short-url/pull/320
.gitattributes file by @erikn69 in https://github.com/ash-jc-allen/short-url/pull/320Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v8.3.1...v8.4.0
Added workflows for running tests with MySQL and Postgres by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/314
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v8.3.0...v8.3.1
Added support for Laravel 12 by @ash-jc-allen in #308
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v8.2.1...v8.3.0
Removed laravel/framework dependency that was accidentally added. 7f3bc3b
laravel/framework dependency that was accidentally added. 7f3bc3bFull Changelog: https://github.com/ash-jc-allen/short-url/compare/v8.2.0...v8.2.1
Add support for PHP 8.4 by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/301
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v8.1.2...v8.2.0
Fixed bug that threw an exception if the short_urls.id column was returned as a string from the database by @rshkabko in https://github.com/ash-jc-all
short_urls.id column was returned as a string from the database by @rshkabko in https://github.com/ash-jc-allen/short-url/pull/297Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v8.1.1...v8.1.2
Fix bug where the OS name cannot be determined from the user agent by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/295
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v8.1.0...v8.1.1
Add ability to specify the allowed URL schemes by @lewis-smith and @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/287 and https://git
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v8.0.1...v8.1.0
Extra ) in conditionals section of the docs by @alexjustesen in https://github.com/ash-jc-allen/short-url/pull/281
) in conditionals section of the docs by @alexjustesen in https://github.com/ash-jc-allen/short-url/pull/281\Carbon\CarbonImmutable by @sshead in https://github.com/ash-jc-allen/short-url/pull/285Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v8.0.0...v8.0.1
Switch from jenssegers/agent to whichbrowser/parser for user agent parsing. #261, #256
jenssegers/agent to whichbrowser/parser for user agent parsing. #261, #256ashallendesign/laravel-config-validator to validate the package's config. #278date property from the ShortURL and ShortURLVisit models. #266Huge thank you to @stevebauman and @marzvrover for their contributions in this release. I really appreciate it! 🚀
Please make sure to check the upgrade guide: https://github.com/ash-jc-allen/short-url/blob/master/UPGRADE.md#upgrading-from-7-to-800
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.10.0...v8.0.0
Add support for nesbot/carbon 3.0 by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/246
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.9.0...v7.10.0
Only add the "utf8mb4_bin" collation if using MySQL by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/241
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.8.2...v7.9.0
Added missing methods to the ShortURL facade's docblock. By @iRaziul in https://github.com/ash-jc-allen/short-url/pull/233
ShortURL facade's docblock. By @iRaziul in https://github.com/ash-jc-allen/short-url/pull/233ShortURL model that prevented a boolean field from being cast. By @ockstadt in https://github.com/ash-jc-allen/short-url/pull/234Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.8.1...v7.8.2
Fixed bug in a database migration that was using the wrong database connection by @jangidgirish in https://github.com/ash-jc-allen/short-url/pull/228
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.8.0...v7.8.1
Added the ability to store custom database fields when creating short URLs by @stevebauman in https://github.com/ash-jc-allen/short-url/pull/225
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.7.0...v7.8.0
Added PHP 8.3 CI tests by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/216
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.6.0...v7.7.0
Added support for hashids/hashids v5 by @boris-glumpler in https://github.com/ash-jc-allen/short-url/pull/183
generateKeyUsing method by @ash-jc-allen and @JoshTrebilco in https://github.com/ash-jc-allen/short-url/pull/185Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.5.1...v7.6.0
Added regression tests for the dates property removed in Laravel 10 by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/182
dates property removed in Laravel 10 by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/182casts property for compatibility with Laravel 10 by @boris-glumpler in https://github.com/ash-jc-allen/short-url/pull/181Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.5.0...v7.5.1
Added the ability to override the default URL domain by @bbredewold in https://github.com/ash-jc-allen/short-url/pull/173
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.4.0...v7.5.0
Add Larastan 2 by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/169
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.3.0...v7.4.0
Added factories for the ShortURL and ShortURLVisit models by @LogicSatinn in https://github.com/ash-jc-allen/short-url/pull/162
ShortURL and ShortURLVisit models by @LogicSatinn in https://github.com/ash-jc-allen/short-url/pull/162Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.2.0...v7.3.0
Added PHP 8.2 support by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/139
when by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/140URL facade import by @stevebauman in https://github.com/ash-jc-allen/short-url/pull/147null prefix bug by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/149 and https://github.com/ash-jc-allen/short-url/pull/158Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.1.0...v7.2.0
fix: Add foreign key name to belongsTo relationship (fixes #131) by @pointybeard in https://github.com/ash-jc-allen/short-url/pull/132
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v7.0.0...v7.1.0
Added ability to remove the prefix from default short URLs by @ash-jc-allen in https://github.com/ash-jc-allen/short-url/pull/123
Full Changelog: https://github.com/ash-jc-allen/short-url/compare/v6.3.0...v7.0.0
Added support for Laravel 9. #116
Updated GitHub Actions to run workflow with PHP 8.1. #106
Added the ability to customise the default short URL's prefix. Huge thanks to @ryangjchandler for this contribution!
Added the ability to forward query parameters to the destination URL. Huge thanks to @julienarcin for this contribution!
Added the ability to configure the hashids alphabet
<h3 id="updated-hashids-alphabet">Added the ability to configure the hashids alphabet (#77)</h3>
You can now specify an alphabet field in your short-url.php config file so that you can specify the range of characters that the Hashids package will use when generating a key.
Huge thanks to @Victor-emil for this contribution!
<h3 id="changed-database-migration">Updated the database migrations for the <code>short_urls</code> table (#80)</h3>
The initial migration that creates the short_urls table has now been updated to make some small improvements. The destination_url field has now been changed from a varchar field to a TEXT field to allow for longer destination URLs to be stored. The url_key field is now unique to prevent any race conditions that allowed duplicated keys to be stored in the database.
Huge thanks to @Victor-emil for this contribution too!
Migrated the CI tests to be run using GitHub Actions instead of Travis CI
<h3 id="migrated-to-github-actions">Migrated the CI tests to be run using GitHub Actions instead of Travis CI (#67)</h3>
Up until now, the tests for the pull requests have been run on Travis CI. But, as of v5.1.0, the tests will now be run on GitHub Actions instead.
Made it mandatory to publish migrations
<h3 id="made-it-mandatory-to-publish-migrations">Made it mandatory to publish migrations (#61)</h3>
Prior to v5.0.0 of Short URL, the database migrations would be automatically loaded via the package's service provider. As of v5.0.0, it's now mandatory for the migrations to be published as they won't be automatically loaded anymore. This gives you more control over the migrations and when/how they are run in your system rather than being forced to run them by the service provider.
To publish the migrations to your own database/migrations folder, run the following command in your project root:
php artisan vendor:publish --tag="short-url-migrations"
Updated the private fields in the ` Builder ` class to be protected
<h3 id="updated-protected-fields">Updated the private fields in the <code> Builder</code> class to be protected (#62 )</h3>
The class-level properties in the Builder class are now protected rather than private to help with extendability.
As of Short URL v4.2.0, the package can now be run using PHP 8.
<h3 id="added-support-for-php-8">Added support for PHP 8 (#58)</h3>
As of Short URL v4.2.0, the package can now be run using PHP 8.
Updated the Travis CI config to run the tests correctly
<h3 id="updated-travis-config">Updated the Travis CI config to run the tests correctly (#55)</h3>
The Travis CI config has now been updated so that it runs the test for this library against the correct version of PHP and Laravel. Previously, the Laravel version was being ignored and the tests were just being run against the latest version (at the time 7.28.0).
Short URL now has support for Laravel 8.
<h3 id="added-laravel-8-support">Added support for Laravel 8 (#54)</h3>
Short URL now has support for Laravel 8.
The ` ShortURLBuilder facade was deprecated in v3.0.0 to fit more with the Laravel naming conventions and standards. As of Short URL, v4.0.0 the Short…
<h3 id="added-optional-config-validation">Added optional config validation (#50)</h3>
Up until now, the values defined in the short-url.php config file were always validated. However, this sometimes caused issues if the application's config was cached before running composer require. A new config variable has been added which can now be used to toggle whether if the validation should be run. By default, the validation is now disabled.
To enable the validation, you can add the following line to your short-url.php config file:
'validate_config' => true,
<h3 id="dropped-laravel-58-support">Dropped Laravel 5.8 support (#51)</h3>
As of Short URL v4.0.0, Laravel 5.8 is no longer supported. Therefore, you must be using a minimum of Laravel 6.0 to use this library.
<h3 id="removed-short-url-builder-facade">Removed the <code>ShortURLBuilder</code> facade (#53)</h3>
The ShortURLBuilder facade was deprecated in v3.0.0 to fit more with the Laravel naming conventions and standards. As of Short URL, v4.0.0 the ShortURLBuilder facade has now been removed in favour of a newer ShortURL facade.
Deprecated the ``` ShortURLBuilder ``` facade in favour of a new ``` ShortURL ``` facade
ShortURLBuilder facade in favour of a new ShortURL facade<h3 id="added-functionality-to-specify-activation-and-deactivation-times-for-short-urls">Added functionality to specify activation and deactivation times for short URLs (#46)</h3>
Up until now, by default, all short URLs that are created are active until you delete them. However, you are now able to set activation and deactivation times for your URLs when creating new ones.
Doing this can be useful for marketing campaigns. For example, you may want to launch a new URL for a marketing campaign on a given date and then automatically deactivate that URL when the marketing campaign comes to an end.
The example below shows how to create a shortened URL that will be active from this time tomorrow onwards and then is deactivated the day after:
$builder = new \AshAllenDesign\ShortURL\Classes\Builder();
$shortURLObject = $builder->activateAt(\Carbon\Carbon::now()->addDay())
->deactivateAt(\Carbon\Carbon::now()->addDays(2))
->make();
<h3 id="deprecated-the--shorturlbuilder--facade-in-favour-of-a-new--shorturl--facade">Deprecated the <code>ShortURLBuilder</code> facade in favour of a new <code>ShortURL</code> facade (#45)</h3>
Up until now, you could use the ShortURLBuilder facade to create a new short URL. However, to make the package fit more with the Laravel naming conventions and consistency, this has now been deprecated.
There is now a newer ShortURL facade which you can use. It works exactly the same and is purely being changed for syntactic sugar.
Note: The ShortURLBuilder will remain in version 3.* of the library but will be removed in version 4.0.0.
The documentation has now been updated to let developers know that they will require the BC Math or GMP PHP extensions.
<h3 id="updated-documentation">Updated documentation (#43)</h3> The documentation has now been updated to let developers know that they will require the BC Math or GMP PHP extensions.
Updated the asset publishing tags
<h3 id="added-support-for-laravel-seven">Added support for Laravel 7 (#38)</h3>
Short URL now has support for Laravel 7!
Credits: Thanks innoflash for the pull request!
<h3 id="updated-asset-publishing-tags">Updated the asset publishing tags (#39)</h3>
Previously, the tags for publishing the migrations and config assets for the package were: config and migrations. These have now been updated to short-url-config and short-url-migrations to be less generic.
Credits: Thanks innoflash for the pull request!
Added a default config option to enforce HTTPS on the destination URL
<h3 id="added-default-config-option-to-encforce-https">Added a default config option to enforce HTTPS on the destination URL (#36)</h3>
Credits: Thanks Carlos A. Escobar for the pull request for this feature!
Up until now, the 'secure' option was enabled by default for all URLs that were created. This meant that unless the ->secure(false) method was explicitly used when creating the short URL, all URLs would redirect to the HTTPS version of the destination URL.
This option can now be defined in the config with the enforce_https field. This field will default to true in the config included with the package. To override this and set your own option, add the following snippet to your
short-url.php config file:
/*
|--------------------------------------------------------------------------
| Enforce HTTPS in the destination URL
|--------------------------------------------------------------------------
|
| Here you may specify if the visitor is redirected to the HTTPS
| version of the destination URL by default. This option can be
| overridden when creating the short URL with the ->secure()
| method.
|
*/
'enforce_https' => true,
Added the key salt as a config option
<h3 id="added-the-key-salt-as-a-config-option">Added the key salt as a config option (#32)</h3>
Up until now, the salt (that was used by an underlying package for generating the unique short URL keys) was defined as a
constant in the AshAllenDesign\ShortURL\Classes\KeyGenerator class. It can now be defined in the config with the
key_salt field.
To set your own key salt, add the following snippet to your short-url.php config file:
/*
|--------------------------------------------------------------------------
| Key Salt
|--------------------------------------------------------------------------
|
| Define the salt that is used to create the unique short
| URL keys. This is used to ensure that the randomly
| generated keys are unique.
|
*/
'key_salt' => 'YOUR SALT HERE',
Added referer URL tracking options
ShortURLVisited event.trackingEnabled() helper methodtrackingFields() helper method<h3 id="added-referer-url-tracking-options">Added referer URL tracking options (#26)</h3>
There is now a new tracking option for the short URLs that allows you to track the referer URL of the visitor. For example, if the short URL is placed on a web page with URL https://domain.com/page-name, that URL will be recorded if the referer URL tracking is enabled.
If you want to override the default config option of whether if referer URL tracking is enabled or not when creating a shortened URL, you can use the ->trackRefererURL() method.
The example below shows how to enable referer URL tracking for the URL and override the default config variable:
$builder = new \AshAllenDesign\ShortURL\Classes\Builder();
$shortURLObject = $builder->destinationUrl('https://destination.com')->trackVisits()->trackRefererURL()->make();
<h3 id="added-device-type-tracking-options">Added device type tracking options (#27)</h3>
There is now a new tracking option for the short URLs that allows you to track the device type of the visitor. There are four possibilities of device type: mobile, desktop, tablet, robot. This can be particularly useful for analytical purposes.
If you want to override the default config option of whether if device type tracking is enabled or not when creating a shortened URL, you can use the ->trackDeviceType() method.
The example below shows how to enable device type tracking for the URL and override the default config variable:
$builder = new \AshAllenDesign\ShortURL\Classes\Builder();
$shortURLObject = $builder->destinationUrl('https://destination.com')->trackVisits()->trackDeviceType()->make();
<h3 id="added-functionality-to-set-the-tracking-options-for-individual-short-urls">Added functionality to set the tracking options for individual short URLs (#29)</h3> Up until now, the tracking options were set in the config and affected all new and existing short URLs. In this release, the tracking options in the config are now used for defining the defaults. These values can now be overridden when creating your short URLs.
Updating the tracking options in the config now won't affect the new short URLs that are created.
The example below shows how to enable IP address tracking for the URL and override the default config variable:
$builder = new \AshAllenDesign\ShortURL\Classes\Builder();
$shortURLObject = $builder->destinationUrl('https://destination.com')->trackVisits()->trackIPAddress()->make();
Learn more about setting the tracking options in the README.
<h3 id="added-functionality-to-set-the-redirect-status-code-for-individual-short-urls">Added functionality to set the redirect status code for individual short URLs (#25)</h3>
Up until now, all short URLs have redirected (if using the package's provided controller) with a 301 HTTP status code. But, this can now be overridden when building the shortened URL using the ->redirectStatusCode() method.
The example below shows how to create a shortened URL with a redirect HTTP status code of 302:
$builder = new \AshAllenDesign\ShortURL\Classes\Builder();
$shortURLObject = $builder->destinationUrl('http://destination.com')->redirectStatusCode(302)->make();
<h3 id="added-a--shorturlvisited-event">Added a <code>ShortURLVisited</code> event (#24)</h3> Each time a short URL is visited, the following event is fired that can be listened on:
AshAllenDesign\ShortURL\Events\ShortURLVisited
This is useful for if you want to trigger some code via listeners whenever a short URL is visited without needing to override the package's provided controller.
<h3 id="added--trackingenabled--helper-method">Added <code>trackingEnabled()</code> helper method (#30)</h3>
To check if tracking is enabled for a short URL, you can use the ->trackingEnabled() method. It will return true if tracking is enabled, and false if not.
The following example shows how to check if a short URL has tracking enabled:
$shortURL = \AshAllenDesign\ShortURL\Models\ShortURL::first();
$shortURL->trackingEnabled();
<h3 id="added--trackingfields--helper-method">Added <code>trackingFields()</code> helper method (#30)</h3>
To check which fields are enabled for tracking for a short URL, you can use the ->trackingFields() method. It will return an array with the names of each field that is currently enabled for tracking.
The following example shows how to get an array of all tracking-enabled fields for a short URL:
$shortURL = \AshAllenDesign\ShortURL\Models\ShortURL::first();
$shortURL->trackingFields();
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.