PHPackages                             phpsa/laravel-yourls-plugin - 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. phpsa/laravel-yourls-plugin

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

phpsa/laravel-yourls-plugin
===========================

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

1.4.0(2y ago)172.9k↓100%7[2 issues](https://github.com/phpsa/laravel-yourls-plugin/issues)MITPHPPHP ^7.1|^8.0|^8.1

Since Jul 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/phpsa/laravel-yourls-plugin)[ Packagist](https://packagist.org/packages/phpsa/laravel-yourls-plugin)[ GitHub Sponsors](https://github.com/phpsa)[ RSS](/packages/phpsa-laravel-yourls-plugin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (9)Used By (0)

Laravel Yourls Plugin
=====================

[](#laravel-yourls-plugin)

[![For Laravel 5](https://camo.githubusercontent.com/dbbc37daad0d7253564d66424e74b3d928f97b0a3bc76243b13bf465a8ede7b0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e38253230746f253230352e382d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpsa/laravel-api-controller/issue)[![Build Status](https://camo.githubusercontent.com/c0a7da541ef385e5bf44c1b7395c36fdf20487de360b4b8b4960b576ad2632f8/68747470733a2f2f7472617669732d63692e6f72672f70687073612f6c61726176656c2d796f75726c732d706c7567696e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phpsa/laravel-yourls-plugin)[![styleci](https://camo.githubusercontent.com/84f96a96376bd85917c333e2aea5d496221c8603d49b5866e5e69de3d9d01f3b/68747470733a2f2f7374796c6563692e696f2f7265706f732f3139363038333735352f736869656c64)](https://styleci.io/repos/196083755)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/dedb1fd888d75d28bd2d1035191c0bdedc01670fdb7c6c783f9abfe94ab5a4d8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70687073612f6c61726176656c2d796f75726c732d706c7567696e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phpsa/laravel-yourls-plugin/?branch=master)[![Coverage Status](https://camo.githubusercontent.com/52e28a691287f88196747e756b87413e36ed96dbec66c3e5275820c9b76f2d6f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f70687073612f6c61726176656c2d796f75726c732d706c7567696e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/phpsa/laravel-yourls-plugin?branch=master)

[![Packagist](https://camo.githubusercontent.com/2a015b64cacb9d6ef834e67e9f9ba8768252307b8a6f066c78097e1c52217c3f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70687073612f6c61726176656c2d796f75726c732d706c7567696e2e737667)](https://packagist.org/packages/phpsa/laravel-yourls-plugin)[![Packagist](https://camo.githubusercontent.com/e90a47df98d3ee203431c0ae4b4960ea62fca1611654ec0deedb0e1575353a87/68747470733a2f2f706f7365722e707567782e6f72672f70687073612f6c61726176656c2d796f75726c732d706c7567696e2f642f746f74616c2e737667)](https://packagist.org/packages/phpsa/laravel-yourls-plugin)[![Packagist](https://camo.githubusercontent.com/780514cfc73d8fbf868f3495812d0d6dc3acbfc2587fe2559d1127daf1ba6a48/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70687073612f6c61726176656c2d796f75726c732d706c7567696e2e737667)](https://packagist.org/packages/phpsa/laravel-yourls-plugin)[![Github Issues](https://camo.githubusercontent.com/cd55e11913b17017b26aac3d6488f0cada735f9e41536f70a0fec2c8519587db/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f415243414e454445562f537570706f72742e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpsa/laravel-api-controller/issue)

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

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

[](#installation)

Install via composer

```
composer require phpsa/laravel-yourls-plugin
```

### Register Service Provider

[](#register-service-provider)

**Note! This and next step are optional if you use laravel&gt;=5.5 with package auto discovery feature.**

Add service provider to `config/app.php` in `providers` section

```
Phpsa\LaravelYourlsPlugin\ServiceProvider::class,
```

### Register Facade

[](#register-facade)

Register package facade in `config/app.php` in `aliases` section

```
'ShortUrl' => Phpsa\LaravelYourlsPlugin\Facades\LaravelYourlsPlugin::class,
```

### Publish Configuration File (optional)

[](#publish-configuration-file-optional)

```
php artisan vendor:publish --provider="Phpsa\LaravelYourlsPlugin\ServiceProvider" --tag="config"
```

### Configuration Settings

[](#configuration-settings)

you can set the following values in your environment file

```
LARAVEL_YOURLS_PLUGIN_URL=
LARAVEL_YOURLS_PLUGIN_USERNAME=
LARAVEL_YOURLS_PLUGIN_PASSWORD=
LARAVEL_YOURLS_PLUGIN_SIGNATURE=
LARAVEL_YOURLS_PLUGIN_FORMAT=json
```

Authentication can use either the username / password combo or the signature

Usage
-----

[](#usage)

using the Facade: you can access the following methods:

### shorturl

[](#shorturl)

*Generates a short url for your long url*

```
\ShortUrl::shorturl(string $url [, string $title = NULL [], string $keyword = NULL [], string $format = NULL ]]] )
```

**Parameters**

- *$url* - required - the url you wish to create a short url for
- *$title* - optional - Title of the short url
- *$keyword* - optional - Title for the short url (ie short.url/{keyword})
- *$format* - optional - Change the format for this specific request (json / xml)

**Returns**string - the short url that was generated

### expand

[](#expand)

*Expands inforation about your short url*

```
\ShortUrl::expand(string $shorturl [, string $format = null] )
```

**Parameters**

- *$shorturl* - required - the shorturl to expand (can be either 'abc' or '')
- *$format* - optional - Change the format for this specific request (json / xml)

**Returns**stdClass - object of the response details

### urlStats

[](#urlstats)

*Get stats about one short URL*

```
\ShortUrl::expand(string $shorturl [, string $format = null] )
```

**Parameters**

- *$shorturl* - required - the shorturl to expand (can be either 'abc' or '')
- *$format* - optional - Change the format for this specific request (json / xml)

**Returns**stdClass - object of the response details

### stats

[](#stats)

*Get stats about one short URL*

```
\ShortUrl::stats( [string $filter = null [, int $limit = null [, string $format = null ]]] )
```

**Parameters**

- *$filter* - optional - the filter: either "top", "bottom" , "rand" or "last"
- *$limit* - optional - the limit (maximum number of links to return)
- *$format* - optional - Change the format for this specific request (json / xml)

**Returns**stdClass - object of the response details

### dbStats

[](#dbstats)

*Get stats about one short URL*

```
\ShortUrl::dbStats([ string $format = null] )
```

**Parameters**

- *$format* - optional - Change the format for this specific request (json / xml)

**Returns**stdClass - object of the response details

### getLastResponse

[](#getlastresponse)

*Gets the full response body from the last request*

```
\ShortUrl::getLastResponse()
```

**Parameters**N/A

**Returns**stdClass|string response of the last request body

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Craig Smith](https://github.com/phpsa)
- [All contributors](https://github.com/phpsa/laravel-yourls-plugin/graphs/contributors)

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~321 days

Recently: every ~401 days

Total

6

Last Release

888d ago

PHP version history (4 changes)1.0.0PHP &gt;=7.0

1.1.0PHP &gt;=7.1

1.3.0PHP ^7.1|^8.0

1.4.0PHP ^7.1|^8.0|^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/bbe4c97ef26aca9d6792775ea44a4c83215881b158f2d3894279c7b73bedda3c?d=identicon)[phpsa](/maintainers/phpsa)

---

Top Contributors

[![phpsa](https://avatars.githubusercontent.com/u/952595?v=4)](https://github.com/phpsa "phpsa (18 commits)")[![craigAtCD](https://avatars.githubusercontent.com/u/152445143?v=4)](https://github.com/craigAtCD "craigAtCD (15 commits)")[![Razorsheep](https://avatars.githubusercontent.com/u/459217?v=4)](https://github.com/Razorsheep "Razorsheep (3 commits)")[![mohan-nishit](https://avatars.githubusercontent.com/u/8962159?v=4)](https://github.com/mohan-nishit "mohan-nishit (1 commits)")

---

Tags

laravelurl shortenerShorturlyourls

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phpsa-laravel-yourls-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/phpsa-laravel-yourls-plugin/health.svg)](https://phpackages.com/packages/phpsa-laravel-yourls-plugin)
```

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[adrianorosa/laravel-geolocation

Laravel Geo Location package to get details for a given IP Address

6593.3k1](/packages/adrianorosa-laravel-geolocation)[bakame/laravel-domain-parser

Laravel package to integrate PHP Domain parser.

26534.8k4](/packages/bakame-laravel-domain-parser)[ankurk91/laravel-ses-webhooks

Handle AWS SES webhooks in Laravel php framework

2534.2k](/packages/ankurk91-laravel-ses-webhooks)

PHPackages © 2026

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