PHPackages                             orlovtech/short-link - 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. orlovtech/short-link

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

orlovtech/short-link
====================

Link shortener package for Laravel

v0.6.0(8mo ago)07701MITPHPPHP ^8.1CI passing

Since Jul 24Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/orlovtech/short-link)[ Packagist](https://packagist.org/packages/orlovtech/short-link)[ RSS](/packages/orlovtech-short-link/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (6)Versions (8)Used By (0)

Laravel Link Shortener
======================

[](#laravel-link-shortener)

[![Latest Version](https://camo.githubusercontent.com/b1ebf90a41436a28455c0a99a0d362d3dbb00a08008dea35a0cb19ef4da6cc4d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f726c6f76746563682f73686f72742d6c696e6b2e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/orlovtech/short-link)[![PHP Version](https://camo.githubusercontent.com/efda8fa491e631e729899b10d2a1c7b8894842a796ffb3da440aca13142645cb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6f726c6f76746563682f73686f72742d6c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://php.net)[![Tests](https://github.com/orlovtech/short-link/actions/workflows/ci-tests.yml/badge.svg)](https://github.com/orlovtech/short-link/actions/workflows/ci-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/29db0a33272221f3031ec1cac8cdf694b8834ec4be7960ec70729e371c9450ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f726c6f76746563682f73686f72742d6c696e6b2e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6d656469756d76696f6c6574726564)](https://packagist.org/packages/orlovtech/short-link)

Table of Contents
-----------------

[](#table-of-contents)

- [Overview](#overview)
- [Installation](#installation)
    - [Requirements](#requirements)
    - [Install the Package](#install-the-package)
    - [Publish the Config and Migrations](#publish-the-config-and-migrations)
    - [Migrate the Database](#migrate-the-database)
- [Generate the Link](#generate-the-link)
- [Use the link](#use-the-link)
- [Testing](#testing)
- [License](#license)

Overview
--------

[](#overview)

A Laravel package that can be used for adding shortened URLs to your existing web app.

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

[](#installation)

### Requirements

[](#requirements)

The package has been developed and tested to work with the following minimum requirements:

- PHP &gt;=8.1
- Laravel &gt;=9.0

### Install the Package

[](#install-the-package)

You can install the package via Composer:

```
composer require orlovtech/short-link
```

### Publish the Config and Migrations

[](#publish-the-config-and-migrations)

You can then publish the package's config file and database migrations by using the following command:

```
php artisan vendor:publish --provider="OrlovTech\ShortLink\Providers\ShortLinkServiceProvider"
```

at this config file you can change the prefix you want to use. By default it's a `/short/`.

### Migrate the Database

[](#migrate-the-database)

This package contains one migration that add a new table to the database: `short_links`. To run this migration, simply run the following command:

```
php artisan migrate
```

### Generate the Link

[](#generate-the-link)

The fastest way to generate new link is to use the facade `OrlovTech\ShortLink\Facades\ShortLink` like this:

```
ShortLink::generate('https://yourlink.com');
```

This method will return you short version of your link.

Method `generate` also has the second parameter `singleUse` as an option. With this parameter you can specify that your link should be deleted after it was used for the first time.

So the full view might be:

```
ShortLink::generate(
    'https://yourlink.com',
    singleUse: true,
);
```

To show ready link use param `default_short_url` like so:

```
$link = ShortLink::generate('https://yourlink.com');

echo config('app.url') . $link->default_short_url;
```

### Use the link

[](#use-the-link)

When you have ready link you can use the endpoint `https://yourdomain.com/short/628ac418-865a`

where `short` is the prefix from config file

Testing
-------

[](#testing)

To run the package's unit tests, run the following command:

```
vendor/bin/phpunit
```

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance58

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.5% 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 ~127 days

Recently: every ~185 days

Total

7

Last Release

265d ago

PHP version history (3 changes)v0.1.0PHP ^8.1|^8.2

v0.4.0PHP ^8.1|^8.2|^8.3

v0.5.0PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![orlovtech](https://avatars.githubusercontent.com/u/5249166?v=4)](https://github.com/orlovtech "orlovtech (23 commits)")[![erikn69](https://avatars.githubusercontent.com/u/4933954?v=4)](https://github.com/erikn69 "erikn69 (3 commits)")

---

Tags

laravellaravel-packagephp8

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/orlovtech-short-link/health.svg)

```
[![Health](https://phpackages.com/badges/orlovtech-short-link/health.svg)](https://phpackages.com/packages/orlovtech-short-link)
```

###  Alternatives

[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[illuminatech/balance

Provides support for Balance accounting system based on debit and credit principle

16137.4k](/packages/illuminatech-balance)[glhd/special

1929.4k](/packages/glhd-special)

PHPackages © 2026

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