PHPackages                             tly/laravel-url-shortener-api - 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. [API Development](/categories/api)
4. /
5. tly/laravel-url-shortener-api

ActiveLibrary[API Development](/categories/api)

tly/laravel-url-shortener-api
=============================

A Laravel package for the T.LY URL Shortener API

v1.1.1(2mo ago)0372MITPHPPHP ^8.0

Since Dec 15Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/tlyshortener/t.ly-laravel-url-shortener-api)[ Packagist](https://packagist.org/packages/tly/laravel-url-shortener-api)[ Docs](https://github.com/tlyshortener/t.ly-laravel-url-shortener-api)[ RSS](/packages/tly-laravel-url-shortener-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

T.LY Laravel URL Shortener API
==============================

[](#tly-laravel-url-shortener-api)

Laravel wrapper for the [T.LY API](https://t.ly/docs), including full support for the endpoints in the T.LY Postman collection.

Create an API Key
-----------------

[](#create-an-api-key)

1. Register a [T.LY account](https://t.ly/register).
2. Create an [API token](https://t.ly/settings#/api).

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

[](#installation)

```
composer require tly/laravel-url-shortener-api
```

Publish config:

```
php artisan vendor:publish --provider="TLY\\LaravelUrlShortener\\TLYServiceProvider" --tag=config
```

Set environment values:

```
TLY_API_TOKEN=your_api_token_here
TLY_API_BASE_URL=https://api.t.ly/api/v1
```

Usage
-----

[](#usage)

```
use TLY\LaravelUrlShortener\Facades\TLYApi;
```

All methods return decoded JSON from the T.LY API.

### Quick Start

[](#quick-start)

```
$created = TLYApi::create([
    'long_url' => 'https://example.com',
    'description' => 'Example Link',
]);

$stats = TLYApi::stats('https://t.ly/abc1', [
    'start_date' => '2025-08-01T00:00:00Z',
    'end_date' => '2025-08-31T23:59:59Z',
]);
```

Method Reference
----------------

[](#method-reference)

### Short Links

[](#short-links)

API EndpointMethodService Method`/api/v1/link/shorten``POST``create(array $data)``/api/v1/link``GET``get(string $shortUrl)``/api/v1/link``PUT``update(array $data)``/api/v1/link``DELETE``delete(string $shortUrl)``/api/v1/link/list``GET``list(array $params = [])``/api/v1/link/list``GET``listShortLinks(array $params = [])``/api/v1/link/expand``POST``expand(string $shortUrl, ?string $password = null, array $payload = [])``/api/v1/link/bulk``POST``bulk(array $payload)``/api/v1/link/bulk/update``POST``bulkUpdate(array $payload)``/api/v1/link/stats``GET``stats(string $shortUrl, array $params = [])`Example:

```
$expanded = TLYApi::expand('https://t.ly/OYXL', 'password123');

$links = TLYApi::listShortLinks([
    'search' => 'amazon',
    'tag_ids' => [1, 2, 3],
    'pixel_ids' => [1, 2, 3],
]);
```

### OneLinks

[](#onelinks)

API EndpointMethodService Method`/api/v1/onelink/stats``GET``oneLinkStats(string $shortUrl, ?string $startDate = null, ?string $endDate = null, array $params = [])``/api/v1/onelink/stat``DELETE``deleteOneLinkStats(string $shortUrl)``/api/v1/onelink/list``GET``listOneLinks(array $params = [])`Example:

```
$oneLinkStats = TLYApi::oneLinkStats(
    'https://t.ly/one',
    '2024-06-01',
    '2024-06-08'
);

$oneLinks = TLYApi::listOneLinks(['page' => 1]);
```

### UTM Preset Methods

[](#utm-preset-methods)

API EndpointMethodService Method`/api/v1/link/utm-preset``POST``createUtmPreset(array $payload)``/api/v1/link/utm-preset``GET``listUtmPresets(array $params = [])``/api/v1/link/utm-preset/{id}``GET``getUtmPreset($id)``/api/v1/link/utm-preset/{id}``PUT``updateUtmPreset($id, array $payload)``/api/v1/link/utm-preset/{id}``DELETE``deleteUtmPreset($id)`Example:

```
$preset = TLYApi::createUtmPreset([
    'name' => 'Newsletter Launch',
    'source' => 'newsletter',
    'medium' => 'email',
    'campaign' => 'fall_launch',
]);
```

### Pixels

[](#pixels)

API EndpointMethodService Method`/api/v1/link/pixel``POST``createPixel(array $payload)``/api/v1/link/pixel``GET``listPixels(array $params = [])``/api/v1/link/pixel/{id}``GET``getPixel($id)``/api/v1/link/pixel/{id}``PUT``updatePixel($id, array $payload)``/api/v1/link/pixel/{id}``DELETE``deletePixel($id)`Example:

```
$pixel = TLYApi::createPixel([
    'name' => 'GTMPixel',
    'pixel_id' => 'GTM-xxxx',
    'pixel_type' => 'googleTagManager',
]);
```

### QR Codes

[](#qr-codes)

API EndpointMethodService Method`/api/v1/link/qr-code``GET``getQrCode(string $shortUrl, array $params = [])``/api/v1/link/qr-code``PUT``updateQrCode(array $payload)`Example:

```
$qr = TLYApi::getQrCode('https://t.ly/c55j', [
    'output' => 'base64',
    'format' => 'eps',
]);
```

### Tags

[](#tags)

API EndpointMethodService Method`/api/v1/link/tag``GET``listTags(array $params = [])``/api/v1/link/tag``POST``createTag(array $payload)``/api/v1/link/tag/{id}``GET``getTag($id)``/api/v1/link/tag/{id}``PUT``updateTag($id, array $payload)``/api/v1/link/tag/{id}``DELETE``deleteTag($id)`Example:

```
$tag = TLYApi::createTag(['tag' => 'fall2026']);
```

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance83

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Total

5

Last Release

84d ago

### Community

Maintainers

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

---

Top Contributors

[![timleland](https://avatars.githubusercontent.com/u/1711910?v=4)](https://github.com/timleland "timleland (8 commits)")

---

Tags

laravelurl shortenerlink-shortenerurl shortener apilink shortener apit.ly

### Embed Badge

![Health badge](/badges/tly-laravel-url-shortener-api/health.svg)

```
[![Health](https://phpackages.com/badges/tly-laravel-url-shortener-api/health.svg)](https://phpackages.com/packages/tly-laravel-url-shortener-api)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[phplicengine/bitly

Bitly API v4

22277.3k](/packages/phplicengine-bitly)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)

PHPackages © 2026

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