PHPackages                             canducci/shorten - 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. canducci/shorten

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

canducci/shorten
================

Canducci Shorten Url

v0.0.1(10y ago)013MITPHPPHP &gt;=5.3.0

Since Dec 19Pushed 10y agoCompare

[ Source](https://github.com/netdragoon/shorten)[ Packagist](https://packagist.org/packages/canducci/shorten)[ Docs](https://github.com/netdragoon/shorten)[ RSS](/packages/canducci-shorten/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

\##Canducci Shorten Url

**Providers:** *BitLy*, *Googl*, *IsGd*, *MigreMe*, *TinyUrl* and *TrIm.*

[![Build Status](https://camo.githubusercontent.com/0452d0b73f2fd06ced4b4ca2f5180f70abfe65ebe905f990a34e360740c14317/68747470733a2f2f7472617669732d63692e6f72672f6e6574647261676f6f6e2f73686f7274656e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/netdragoon/shorten)[![Packagist](https://camo.githubusercontent.com/f86baf29801115cdccd23aa591fc7c99db3b1d8a46703695a320d7faacc0d7a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616e64756363692f73686f7274656e2e7376673f7374796c653d666c6174)](https://packagist.org/packages/canducci/shorten)[![Packagist](https://camo.githubusercontent.com/2c3d982655933bf5b5f92ef3ce6c338d2420e18a77154c40b7b47bba73b6ebf9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f63616e64756363692f73686f7274656e2e7376673f7374796c653d666c6174)](https://packagist.org/packages/canducci/shorten)[![Packagist](https://camo.githubusercontent.com/e2e4f634b960c768b7caa6200fee30985ce7a9787cb8523b51d9775bf5ea27ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f63616e64756363692f73686f7274656e2e7376673f7374796c653d666c6174)](https://packagist.org/packages/canducci/shorten)[![Packagist](https://camo.githubusercontent.com/fe4bc6c8b619ef344bea5c92076a95acbda2bb985c512fe67e20f555aebf17f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63616e64756363692f73686f7274656e2e737667)](https://packagist.org/packages/canducci/shorten)[![Packagist](https://camo.githubusercontent.com/af9291e3ec688d0b6af0e0627ea9c7195709b6bc330a52d09d55ba0b9d3719a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63616e64756363692f73686f7274656e2e7376673f6c6162656c3d76657273696f6e)](https://packagist.org/packages/canducci/shorten)![](https://camo.githubusercontent.com/be98eaba676195d6c392b56beb93485b5b9a72a94469c423ae3f6bd98169bcd6/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f68747470732f7061636b61676973742e6f72672f7061636b616765732f63616e64756363692f73686f7274656e2e7376673f7374796c653d736f6369616c)

The package offers providers in their most current version can be selected for obtaining URL shortened. Are they:

- Bitly ()
- Googl ([https://developers.google.com/url-shortener/v1/getting\_started](https://developers.google.com/url-shortener/v1/getting_started))
- IsGd ()
- MigreMe ()
- TinyUrl ()
- TrIm ()

All of these providers work in a clear and objective manner to generate the urls, of course you must choose one or perhaps all for the generation of short url for your systems.

Quick start
-----------

[](#quick-start)

### Required setup

[](#required-setup)

In the `require` key of `composer.json` file add the following

```
"canducci/shorten": "0.0.1"
```

Run the Composer update comand

```
$ composer update
```

In your `config/app.php` add `providers` array

```
'providers' => [
    ...,
    Canducci\Shorten\Providers\ShortenServiceProvider::class,

```

At the end of `config/app.php` add o `aliases` (Facade) in array

```
'aliases' => [
    ...,
    'Shorten' => Canducci\Shorten\Facades\Shorten::class,
    'IsGd' => Canducci\Shorten\Facades\IsGd::class,
    'TinyUrl' => Canducci\Shorten\Facades\TinyUrl::class,
    'TrIm' => Canducci\Shorten\Facades\TrIm::class,
    'Googl' => Canducci\Shorten\Facades\Googl::class,
    'MigreMe' => Canducci\Shorten\Facades\MigreMe::class,
    'Bitly' => Canducci\Shorten\Facades\Bitly::class,
```

### How to use?

[](#how-to-use)

Simple example using only one of the providers (IsGd):

```
$provider = IsGd::create('https://packagist.org/packages/canducci/shorten');

$shorten = Shorten::create($provider);

$receive = $shorten->receive();

var_dump($receive);
var_dump($receive->getLongUrl());
var_dump($receive->getShortUrl());
var_dump($receive->getProviderType()->getName());
var_dump($receive->getProviderType()->getAddress());

//results
object(Canducci\Shorten\ShortenReceive)#225 (3) {
  ["longurl":protected]=>
  string(47) "https://packagist.org/packages/canducci/shorten"
  ["shorturl":protected]=>
  string(19) "http://is.gd/amftYu"
  ["providerType":protected]=>
  object(Canducci\Shorten\ShortenProviderType)#224 (2) {
    ["name":protected]=>
    string(4) "IsGd"
    ["address":protected]=>
    string(13) "http://is.gd/"
  }
}

string(47) "https://packagist.org/packages/canducci/shorten"

string(19) "http://is.gd/amftYu"

string(4) "IsGd"

string(13) "http://is.gd/"
```

*Injection Contracts*

```
Route::get('shorten1',
    function(
        Canducci\Shorten\Contracts\IsGdContract $isgd,
        Canducci\Shorten\Contracts\TinyUrlContract $tinyurl,
        Canducci\Shorten\Contracts\MigreMeContract $migreme,
        Canducci\Shorten\Contracts\BitlyContract $bitly,
        Canducci\Shorten\Contracts\GooglContract $googl,
        Canducci\Shorten\Contracts\TrImContract $trim,
        Canducci\Shorten\Contracts\ShortenContract $shorten
    )
{

    $provider0 = $isgd->create('https://packagist.org/packages/canducci/shorten');
    $provider1 = $tinyurl->create('https://packagist.org/packages/canducci/shorten');
    $provider2 = $migreme->create('https://packagist.org/packages/canducci/shorten');
    $provider3 = $bitly->create('https://packagist.org/packages/canducci/shorten','key_bitly');
    $provider4 = $googl->create('https://packagist.org/packages/canducci/shorten','key_google');
    $provider5 = $trim->create('https://packagist.org/packages/canducci/shorten','key_api');

    $shorten0 = $shorten->create($provider0);
    $shorten1 = $shorten->newInstance()->create($provider1);
    $shorten2 = $shorten->newInstance()->create($provider2);
    $shorten3 = $shorten->newInstance()->create($provider3);
    $shorten4 = $shorten->newInstance()->create($provider4);
    $shorten5 = $shorten->newInstance()->create($provider5);

    echo $shorten0->receive()->getShortUrl();
    echo '';
    echo $shorten1->receive()->getShortUrl();
    echo '';
    echo $shorten2->receive()->getShortUrl();
    echo '';
    echo $shorten3->receive()->getShortUrl();
    echo '';
    echo $shorten4->receive()->getShortUrl();
    echo '';
    echo $shorten5->receive()->getShortUrl();

    return;

});
```

*Facades*

```
$provider0 = IsGd::create('https://packagist.org/packages/canducci/shorten');
$provider1 = TinyUrl::create('https://packagist.org/packages/canducci/shorten');
$provider2 = MigreMe::create('https://packagist.org/packages/canducci/shorten');
$provider3 = Bitly::create('https://packagist.org/packages/canducci/shorten','key_bitly');
$provider4 = Googl::create('https://packagist.org/packages/canducci/shorten','key_google');
$provider5 = TrIm::create('https://packagist.org/packages/canducci/shorten','key_api');

$shorten0 = Shorten::create($provider0);
$shorten1 = Shorten::newInstance()->create($provider1);
$shorten2 = Shorten::newInstance()->create($provider2);
$shorten3 = Shorten::newInstance()->create($provider3);
$shorten4 = Shorten::newInstance()->create($provider4);
$shorten5 = Shorten::newInstance()->create($provider5);

echo $shorten0->receive()->getShortUrl();
echo '';
echo $shorten1->receive()->getShortUrl();
echo '';
echo $shorten2->receive()->getShortUrl();
echo '';
echo $shorten3->receive()->getShortUrl();
echo '';
echo $shorten4->receive()->getShortUrl();
echo '';
echo $shorten5->receive()->getShortUrl();
```

*Functions*

```
$provider0 = isgd('https://packagist.org/packages/canducci/shorten');
$provider1 = tinyurl('https://packagist.org/packages/canducci/shorten');
$provider2 = migreme('https://packagist.org/packages/canducci/shorten');
$provider3 = bitly('https://packagist.org/packages/canducci/shorten','key_bitly');
$provider4 = googl('https://packagist.org/packages/canducci/shorten','key_google');
$provider5 = tr_im('https://packagist.org/packages/canducci/shorten','key_api');

$shorten0 = shorten($provider0);
$shorten1 = shorten($provider1);
$shorten2 = shorten($provider2);
$shorten3 = shorten($provider3);
$shorten4 = shorten($provider4);
$shorten5 = shorten($provider5);

echo $shorten0->receive()->getShortUrl();
echo '';
echo $shorten1->receive()->getShortUrl();
echo '';
echo $shorten2->receive()->getShortUrl();
echo '';
echo $shorten3->receive()->getShortUrl();
echo '';
echo $shorten4->receive()->getShortUrl();
echo '';
echo $shorten5->receive()->getShortUrl();
```

*Single Instance*

```
$provider0 = new \Canducci\Shorten\IsGd('https://packagist.org/packages/canducci/shorten');
$provider1 = new \Canducci\Shorten\TinyUrl('https://packagist.org/packages/canducci/shorten');
$provider2 = new \Canducci\Shorten\MigreMe('https://packagist.org/packages/canducci/shorten');
$provider3 = new \Canducci\Shorten\Bitly('https://packagist.org/packages/canducci/shorten','key_bitly');
$provider4 = new \Canducci\Shorten\Googl('https://packagist.org/packages/canducci/shorten','key_google');
$provider5 = new \Canducci\Shorten\TrIm('https://packagist.org/packages/canducci/shorten','key_api');

$shorten0 = new \Canducci\Shorten\Shorten($provider0);
$shorten1 = new \Canducci\Shorten\Shorten($provider1);
$shorten2 = new \Canducci\Shorten\Shorten($provider2);
$shorten3 = new \Canducci\Shorten\Shorten($provider3);
$shorten4 = new \Canducci\Shorten\Shorten($provider4);
$shorten5 = new \Canducci\Shorten\Shorten($provider5);

echo $shorten0->receive()->getShortUrl();
echo '';
echo $shorten1->receive()->getShortUrl();
echo '';
echo $shorten2->receive()->getShortUrl();
echo '';
echo $shorten3->receive()->getShortUrl();
echo '';
echo $shorten4->receive()->getShortUrl();
echo '';
echo $shorten5->receive()->getShortUrl();
```

### Note

[](#note)

These three providers below must have a register in that site to be released to generate short url with token or key provided on the same register.

- Bitly (key\_bitly) ()
- Googl (key\_google) ([https://developers.google.com/url-shortener/v1/getting\_started](https://developers.google.com/url-shortener/v1/getting_started))
- TrIm (key\_api) ()

Different from the others only need to have information as to url so long to run the code successfully.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

3840d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/43fc765f09ee564408d8da952d2ea824c1c8d2ab7e0aa055885fa011d92082fa?d=identicon)[fulviocanducci](/maintainers/fulviocanducci)

---

Top Contributors

[![netdragoon](https://avatars.githubusercontent.com/u/15145509?v=4)](https://github.com/netdragoon "netdragoon (21 commits)")

---

Tags

urlbitlyprovidersis.gdtrimgoogltinyurlcanduccishorten-urlMigreMe

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/canducci-shorten/health.svg)

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

###  Alternatives

[yourls/yourls

Your Own URL Shortener

12.1k27.8k1](/packages/yourls-yourls)[laracrafts/laravel-url-shortener

Powerful URL shortening tools in Laravel

97112.0k](/packages/laracrafts-laravel-url-shortener)[shivella/laravel-bitly

Laravel package for generating bitly url

74840.9k1](/packages/shivella-laravel-bitly)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[vinelab/url-shortener

URL shortening the easy way.

5917.2k](/packages/vinelab-url-shortener)

PHPackages © 2026

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