PHPackages                             mlopez/url-shortener - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mlopez/url-shortener

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mlopez/url-shortener
====================

v1.0.0(3y ago)06MITPHPPHP &gt;7.2

Since Mar 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/parrotsoft/url-shortener)[ Packagist](https://packagist.org/packages/mlopez/url-shortener)[ RSS](/packages/mlopez-url-shortener/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

urlShortener
============

[](#urlshortener)

This package implements a URL shortener in your Laravel project, using a migration and two access routes. It also comes with a configuration file to adjust what you consider necessary.

Installation
------------

[](#installation)

Use composer to install the package.

```
composer require mlopez/url-shortener

```

Optionally, you can publish the configuration file and the migration.

```
php artisan vendor:publish --tag=url-shortener-migrations

```

```
php artisan vendor:publish --tag=url-shortener-config

```

After composer installs the package, run the following command to run the migration and register the routes.

```
php artisan url-shortene:install

```

Test
----

[](#test)

```
public function test_url_shortener()
{
    $this->post(route('links.store'), [
        'long_url' => 'https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers'
    ]);

    $this->assertDatabaseHas(config('urlshortener.table'), [
        'long_url' => 'https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers'
    ]);
}
```

### Response

[](#response)

```
{
  "id": 16,
  "long_url": "https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers",
  "code": "5TPcKQ",
  "short_url": "https://123url.com/5TPcKQ", 🏹
  "updated_at": "2023-03-25T04:59:32.000000Z",
  "created_at": "2023-03-25T04:59:32.000000Z"
}
```

Credits
-------

[](#credits)

- [Miguel Lopez Ariza](https://github.com/parrotsoft)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1149d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5cd183a5ab6a0a7891a1f7c2faa36a63049cebb1ee32e0cdc0dd6a5944ac0750?d=identicon)[mlopez](/maintainers/mlopez)

---

Top Contributors

[![parrotsoft](https://avatars.githubusercontent.com/u/5466680?v=4)](https://github.com/parrotsoft "parrotsoft (2 commits)")

---

Tags

urllaravelurl shortener

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mlopez-url-shortener/health.svg)

```
[![Health](https://phpackages.com/badges/mlopez-url-shortener/health.svg)](https://phpackages.com/packages/mlopez-url-shortener)
```

###  Alternatives

[cybercog/laravel-optimus

An Optimus bridge for Laravel. Id obfuscation based on Knuth's multiplicative hashing method.

192564.1k](/packages/cybercog-laravel-optimus)[dusterio/link-preview

Link preview generation for PHP with Laravel support

126326.6k3](/packages/dusterio-link-preview)[vinelab/url-shortener

URL shortening the easy way.

6217.2k](/packages/vinelab-url-shortener)[laracrafts/laravel-url-shortener

Powerful URL shortening tools in Laravel

97110.7k](/packages/laracrafts-laravel-url-shortener)[phpsa/laravel-yourls-plugin

Plugin which integrates Laravel with Yourls (Your Own URL Shortener).

172.9k](/packages/phpsa-laravel-yourls-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
