Laravel Short Url is a package allowing you to shorten urls.
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
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
Instead of adding ShortUrl::routes();
you can call three separates methods:
ShortUrl::createRoutes();
to shorten urlsShortUrl::manageRoutes();
to manage urlsShortUrl::redirectRoute();
to redirect to the url
this allows you to add middlewares or prefix routes.
Laravel short url is now set up on your homepage.