Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gallib/laravel-short-url
A Laravel package to shorten urls
https://github.com/gallib/laravel-short-url
laravel laravel-package laravel9 package shorten-urls shortener url url-shortener
Last synced: 27 days ago
JSON representation
A Laravel package to shorten urls
- Host: GitHub
- URL: https://github.com/gallib/laravel-short-url
- Owner: gallib
- License: mit
- Created: 2018-02-23T14:10:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T23:44:11.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T04:35:24.971Z (7 months ago)
- Topics: laravel, laravel-package, laravel9, package, shorten-urls, shortener, url, url-shortener
- Language: PHP
- Homepage:
- Size: 152 KB
- Stars: 163
- Watchers: 6
- Forks: 38
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Short Url [![Build Status](https://travis-ci.org/gallib/laravel-short-url.svg?branch=master)](https://travis-ci.org/gallib/laravel-short-url) [![StyleCI](https://styleci.io/repos/122629531/shield?branch=master)](https://styleci.io/repos/122629531)
Laravel Short Url is a package allowing you to shorten urls.
## Installation
With composer
```
composer require gallib/laravel-short-url
```then run
```
php artisan vendor:publish --provider="Gallib\ShortUrl\ShortUrlServiceProvider"
php artisan migrate
```finally, paste ``` ShortUrl::routes(); ``` at the end of ``` routes/web.php ```
## Configuration
Laravel Short Url configuration file can be found on ``` config/shorturl.php ```
- **blacklist** : Allows to blacklist urls. Keywords can be either an url, a keyword or an extension
### Advanced configuration
Instead of adding ``` ShortUrl::routes(); ``` you can call three separates methods:
- ``` ShortUrl::createRoutes(); ``` to shorten urls
- ``` ShortUrl::manageRoutes(); ``` to manage urls
- ``` ShortUrl::redirectRoute(); ``` to redirect to the urlthis allows you to add middlewares or prefix routes.
### Migration Customization
If you are not going to use Short Url's default migrations, you should call the
`ShortUrl::ignoreMigrations();` method in the `register` method of your `AppServiceProvider`.
You may export the default migrations using```
php artisan vendor:publish --tag=shorturl-migrations
```## Nice!
Laravel short url is now set up on your homepage.
## Credits
- Created by [Alain](https://twitter.com/gallib_net)
- Logo by [Caneco](https://twitter.com/caneco)