Simpler Url Shortener for Laravel

Simpler Url Shortener for Laravel

Written by Marc Garcia on Aug 4th, 2021 Views Report Post

Hello! Marc here.

I've just released a new laravel package. It's very simple, but hope it will help you in some projects.

Thank you! All PRs and suggestions will be welcome!

https://github.com/magarrent/laravel-url-shortener

Laravel Url Shortener

Laravel Url Shortener

Software License Package Size

Install

composer require magarrent/laravel-url-shortener

Usage

Import the UrlShortener in your php file.

use Magarrent\LaravelUrlShortener\Models\UrlShortener;

Then you can use the Url shortener package to redirect internal and external links.

UrlShortener::generateShortUrl("https://www.kodio.tech")

UrlShortener::generateShortUrl("/my-next/local/page")

Ex. Redirection:

https://your.url/H8g9Jx => https://www.kodio.tech


You only have to send the Url To param to the UrlShortener model:

public  static  function  generateShortUrl(String $toUrl):  String

Roadmap

  • Add custom configuration for url key characters (Currently 6)

Changelog

1.0 - First version

Contributing

Please see CONTRIBUTING for details.

Credits

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

Comments (5)