Download the PHP package andrey-helldar/short-url without Composer
On this page you can find all versions of the php package andrey-helldar/short-url. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package short-url
Short URL
A simple short URL generator for Laravel Framework.
This package is abandoned and no longer maintained. The author suggests using the
ashallendesign/short-url
package instead.
Installation
To get the latest version of Laravel Short URL, simply require the project using composer:
Instead, you may of course manually update your require block and run composer update
if you so choose:
If you don't use auto-discovery, add the ServiceProvider
to the providers array in config/app.php
:
You can also publish the config file to change implementations (ie. interface to specific class):
Now you can use a Helldar\ShortUrl\Facades\ShortUrl
facade.
Using
Identifiers
When creating records, there are two ways to create unique identifiers: The first one is by the record identifier in the database with its conversion into a letter index:
id | key | url | output url |
---|---|---|---|
1 | b | https://example.com | https://my-site.com/go/b |
2 | c | https://example.com/foo | https://my-site.com/go/c |
3 | d | https://example.com/bar | https://my-site.com/go/d |
... | ... | ... | ... |
100 | dw | https://example.com/baz | https://my-site.com/go/dw |
200 | hs | https://example.com/qwe | https://my-site.com/go/hs |
... | ... | ... | ... |
1000 | bmm | https://example.com/rty | https://my-site.com/go/bmm |
5000 | hki | https://example.com/qax | https://my-site.com/go/hki |
... | ... | ... | ... |
The second is unique identifier based on the current time in microseconds:
id | key | url | output url |
---|---|---|---|
1 | 5d35b1610705f679245100 | https://example.com | https://my-site.com/go/5d35b1610705f679245100 |
2 | 5d35b1727eb33156257300 | https://example.com/foo | https://my-site.com/go/5d35b1727eb33156257300 |
3 | 5d35c3193aaf8239852915 | https://example.com/bar | https://my-site.com/go/5d35c3193aaf8239852915 |
... | ... | ... | ... |
100 | 5d35c3195eaaa426635669 | https://example.com/baz | https://my-site.com/go/5d35c3195eaaa426635669 |
200 | 5d35c3199d7f7453462663 | https://example.com/qwe | https://my-site.com/go/5d35c3199d7f7453462663 |
... | ... | ... | ... |
1000 | 5d35c31a44398568656171 | https://example.com/rty | https://my-site.com/go/5d35c31a44398568656171 |
5000 | 5d35c31aca1c1975257906 | https://example.com/qax | https://my-site.com/go/5d35c31aca1c1975257906 |
... | ... | ... | ... |
set()
To create a record, use the method set()
:
get()
To get record, use the method get()
:
routing
To create a route you can use the following code:
or
You can also change the name of the route in the package settings.
Blade templates
You can also call the facade from the template engine:
or
License
This package is licensed under the MIT License.
For Enterprise
Available as part of the Tidelift Subscription.
The maintainers of andrey-helldar/short-url
and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. Learn more.
All versions of short-url with dependencies
andrey-helldar/laravel-support Version ^1.1
andrey-helldar/support Version ^2.0|^3.0
illuminate/database Version ^5.5|^6.0|^7.0|^8.0
illuminate/routing Version ^5.5|^6.0|^7.0|^8.0
illuminate/support Version ^5.5|^6.0|^7.0|^8.0
illuminate/validation Version ^5.5|^6.0|^7.0|^8.0