PHPackages                             viewflex/tiny - 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. viewflex/tiny

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

viewflex/tiny
=============

Provides generation and serving of shortened URLs in a Laravel application.

1.0(7y ago)01.1k1[1 PRs](https://github.com/viewflex/tiny/pulls)MITPHP

Since Jun 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/viewflex/tiny)[ Packagist](https://packagist.org/packages/viewflex/tiny)[ RSS](/packages/viewflex-tiny/feed)WikiDiscussions master Synced 3d ago

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

Tiny
====

[](#tiny)

[![GitHub license](https://camo.githubusercontent.com/ee061e6c1798bd95fa104c910010a3119850b186c323a1c848b3abcb029dc764/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e7376673f6d61784167653d32353932303030)](LICENSE.md)

Provides generation and serving of shortened URLs in a Laravel application.

Overview
--------

[](#overview)

### Basic Steps

[](#basic-steps)

- Install this package in your Laravel application.
- Run the database migration to create the table for storing URLs.
- Add URLs manually via the web UI, or programatically via the `TinyService` class.

### Architecture

[](#architecture)

All interaction with the database is handled by a repository class implementing the `TinyQueryInterface` (by default, the `TinyQuery` class). The concrete query class is bound via the package configuration, so it's easy to create and deploy a new query class for an alternate data source (NoSQL, key-value store, etc), without hacking the package itself.

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

[](#installation)

From your Laravel application's root directory, install via Composer:

```
composer require viewflex/tiny
```

Add the `TinyServiceProvider` to the list of providers in `config/app.php`. *Note: This is not necessary when using Laravel 5.5 or greater with package discovery enabled.*

```
Viewflex\Tiny\TinyServiceProvider::class,
```

Migration
---------

[](#migration)

Laravel 5.4 or greater can run the migration directly from the package.

```
php artisan migrate
```

For older versions of Laravel, publish the migration first.

```
php artisan vendor:publish  --tag='tiny-data'
```

Configuration
-------------

[](#configuration)

The `tiny.php` config file contains the package settings.

```
'caching'       => [
	'active'        =>  true,
	'minutes'       =>  1440
],

'query'         => '\Viewflex\Tiny\Queries\TinyQuery',

'tables'        => [
	'urls'          => 'tiny_urls'
]
```

If you need to customize the configuration, run this command to publish the config file to the project's `config` directory:

```
php artisan vendor:publish  --tag='tiny'
```

This will also publish the UI view template to your project's `resources/views/vendor/tiny` directory. Unless you need to customize one of these files it is not necessary to publish them.

### Caching

[](#caching)

By default, URL lookups are cached, which greatly increases performance. You can disable this or change the cache lifetime to suit your needs.

### Query

[](#query)

This is the repository class that interacts with the data source. Any class implementing the `TinyQueryInterface` can be used in place of the default, as needed.

### Tables

[](#tables)

Here the table name is aliased, to allow using whatever table name you want without hacking the package.

Usage
-----

[](#usage)

### Adding URLs

[](#adding-urls)

The `TinyController` provides a UI for adding URLs. Simply enter a URL and click the Save button. The URL will be displayed along with it's alias in the resulting message. The route `/tiny/create` is used to access the UI from a web browser. It is also quite easy to integrate the `TinyService` class into your own code, to generate and store URLs programatically.

### Serving URLs

[](#serving-urls)

Once stored, a URL can be accessed via the `/tiny/{hash}` package route. Of course, if necessary you can also create an additional route to hit the same controller method.

Tests
-----

[](#tests)

Tests can be run in the usual way, as described in the [test documentation](./tests/README.md).

License
-------

[](#license)

This software is offered for use under the [MIT License](LICENSE.md).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Total

2

Last Release

2895d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b93f8b0a642b06fab7cd680ba7a56539f9b77e5c09fae9f26bfcc319128d794?d=identicon)[viewflex](/maintainers/viewflex)

---

Top Contributors

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

---

Tags

laravelurl shortenerurl encodershortened url server

### Embed Badge

![Health badge](/badges/viewflex-tiny/health.svg)

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

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

106106.2k](/packages/whitecube-laravel-timezones)[forxer/laravel-gravatar

A library providing easy gravatar integration in a Laravel project.

4235.6k](/packages/forxer-laravel-gravatar)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

116.6k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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