PHPackages                             ako/shorturl - 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. ako/shorturl

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

ako/shorturl
============

Url shortener

0.0.6(7y ago)042MITPHPPHP ^7.1

Since Jan 4Pushed 7y ago2 watchersCompare

[ Source](https://github.com/akoSalman/Shorturl)[ Packagist](https://packagist.org/packages/ako/shorturl)[ Docs](https://github.com/akoSalman/shorturl)[ RSS](/packages/ako-shorturl/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (5)Versions (12)Used By (0)

shorturl
========

[](#shorturl)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4e2c691b356155b15c06eaa9eab34be58fbbfc1ca86584d55bacba17041ffe20/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616b6f53616c6d616e2f53686f727475726c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/akoSalman/Shorturl/?branch=master) [![Build Status](https://camo.githubusercontent.com/f9ac01b9aec967526ca78af5f65468a853e18df1e4ae5b860a4468cc67d4bccd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616b6f53616c6d616e2f53686f727475726c2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/akoSalman/Shorturl/build-status/master) [![Code Intelligence Status](https://camo.githubusercontent.com/d587425dd2e3578b33cc6cb3595a58cc8706369d413513fcf663237157d75cec/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616b6f53616c6d616e2f53686f727475726c2f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)

Simply launch a url-shortener on your server. As the main purpose of this package is to shorten urls locally, so for now the `local` driver is available and `bitly and google` drivers will be added soon.

**Requirements:**

1- php-7.1

2- Laravel-5.5

**Installation:**

Install via composer:

`composer require ako/shorturl`

Or add ` "ako/shorturl":"^0.0.6"` to the `composer.json` file of your project.

Run `php artisan vendor:publish` to add the `shorturl.php` config file to the `config` folder.

Run `php artisan migrate` to create `links` table.

**Usage:**

You can get an instance of the `Shorturl` through Laravel `Facades`:

```
// Default driver is local
$url = 'http://www.domain.com/here/is/a/long/url';
$short_url = \Shorturl::shorten($url); // http://www.domain.com/abde

// Expand shortened url
$expanded = \Shorturl::expand('http://www.domain.com/abde') // http://www.domain.com/here/is/a/long/url

// Or you can specify the driver
$short_url = \Shorturl::onDriver('local')->shorten($url); // http://www.domain.com/abde
$short_url = \Shorturl::onDriver('bitly')->shorten($url); // http://bit.ly/shortened

// You can add some custom properties when using local driver for later access on the url
$short_url = \Shorturl::onDriver('local')
                  ->withProperties(['key' => value])
                  ->shorten($url); // http://www.domain.com/abde

```

Every time a url is expanded the `clicks` counter for given url is incremented, so you can make some statistics of the links.

You can use `\Ako\Shorturl\Models\Link` model as an `Eloquent` model to get number of `clicks` of each url, stored `properties` or any other staff on the links.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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

Every ~1 days

Total

11

Last Release

2676d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d9a8ce10f29434b8a8246fa373da48af59dcf35962c7e143045fd7bf5b0f83f?d=identicon)[ako](/maintainers/ako)

---

Top Contributors

[![akoSalman](https://avatars.githubusercontent.com/u/17239230?v=4)](https://github.com/akoSalman "akoSalman (27 commits)")

---

Tags

laravel-urllaravle-url-shortenerphp-urlphp-url-shortenerurl-shortenerurlshortenerphplaravelurl shortenerShorturlurlshortenerphp-shorturllaravel-shorturllaravel-urlshortener

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ako-shorturl/health.svg)

```
[![Health](https://phpackages.com/badges/ako-shorturl/health.svg)](https://phpackages.com/packages/ako-shorturl)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[monicahq/laravel-cloudflare

Add Cloudflare ip addresses to trusted proxies for Laravel.

3372.7M4](/packages/monicahq-laravel-cloudflare)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)[kra8/laravel-snowflake

Snowflake for Laravel and Lumen.

188402.3k6](/packages/kra8-laravel-snowflake)[tehwave/laravel-achievements

Simple, elegant Achievements the Laravel way

7012.8k](/packages/tehwave-laravel-achievements)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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