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

AbandonedArchivedLibrary

tzsk/shorten-url
================

Google URL Shortener and Expander for Laravel.

2.0.0(6y ago)510.2k5[2 issues](https://github.com/tzsk/shorten-url/issues)MITPHPPHP ^7.2

Since Mar 2Pushed 6y ago2 watchersCompare

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

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

Shorten Url
===========

[](#shorten-url)

[![Latest Version on Packagist](https://camo.githubusercontent.com/464ee1e8fff50cb93a49d58b45edfd4ff0e3a6e1f9b6b67427ac22e70c9e3816/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747a736b2f73686f7274656e2d75726c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tzsk/shorten-url)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8e5df7ae6f95b4db7a012320264a8f9bd5371edfe44a98730959a3a3681c5865/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f747a736b2f73686f7274656e2d75726c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tzsk/shorten-url/?branch=master)[![Quality Score](https://camo.githubusercontent.com/db99e4339e5df8c06c29adfdc62628e25fb3d0eef73944b51bcaad6892aa1d0f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f747a736b2f73686f7274656e2d75726c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/tzsk/shorten-url)[![Total Downloads](https://camo.githubusercontent.com/8d87ebd27980bdfd1e333306627955d38f2ad0aaf401e3defd262dad94c976c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747a736b2f73686f7274656e2d75726c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tzsk/shorten-url)

Package for Shortening URL and Expanding URL with Google. This is a great combination if you plan to send Links in your Text Messages fired from your Application.

Install
-------

[](#install)

Via Composer

```
$ composer require tzsk/shorten-url
```

Configure
---------

[](#configure)

First add the Service Provider and Facade in your app config file.

```
'providers' => [
    ...
    Tzsk\ShortenUrl\Provider\ShortenUrlServiceProvider::class,
    ...
]
...
'aliases' => [
    ...
    'GoogleUrl' => Tzsk\ShortenUrl\Facade\GoogleUrl::class,
    ...
]
```

After that run `vendor:publish` with flag `config`:

```
$ php artisan vendor:publish --tag=config
```

Once you do that you will have a new file in your config folder. `config/url.php`

There is only one criteria. Google API key for Shortening URL. Just login with google account and go to \[\]

Now create a new Application there. And `Enable API` for URL Shortening. And generate `API Key` to use in `Credentials` section.

Usage
-----

[](#usage)

```
# Use Class Path at the top of the File.
use Tzsk\ShortenUrl\Facade\GoogleUrl;

# Inside your Controller Method for Shortening.

$short = GoogleUrl::shorten("LONG URL"); # Returns String.
# OR...
$short_data = GoogleUrl::extended()->shorten("LONG URL");
/**
* For extended it will give the full response that google provides.
*/

# Inside your Controller Method for Expanding.
$long = GoogleUrl::expand("SHORT URL"); # Returns String.
# OR...
$long_data = GoogleUrl::extended()->expand("SHORT URL");
/**
* For extended it will give the full response that google provides.
*/
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Kazi Mainuddin Ahmed](https://github.com/tzsk)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% 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 ~235 days

Total

5

Last Release

2413d ago

Major Versions

1.0.3 → 2.0.02019-09-30

PHP version history (2 changes)1.0.0PHP ~5.6|~7.0

2.0.0PHP ^7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47768513?v=4)[Kazi Manzur Ahmed](/maintainers/kazimahmed)[@kazimahmed](https://github.com/kazimahmed)

---

Top Contributors

[![tzsk](https://avatars.githubusercontent.com/u/13273787?v=4)](https://github.com/tzsk "tzsk (10 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

---

Tags

google-url-expandgoogle-url-shortenlaravelpackagetzskshorten-url

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[tzsk/collage

Generate Image Collage with Laravel

8161.5k](/packages/tzsk-collage)[tzsk/payu

PayU India Payment Gateway Integration with Laravel

47108.8k6](/packages/tzsk-payu)[tzsk/crypton

Laravel API Request Response Encryption

417.1k](/packages/tzsk-crypton)

PHPackages © 2026

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