PHPackages                             pavelzanek/redirections-laravel - 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. pavelzanek/redirections-laravel

AbandonedArchivedLibrary

pavelzanek/redirections-laravel
===============================

Manage your redirects easily.

1.0.2(3y ago)05MITBladePHP ^8.1

Since Aug 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/PavelZanek/redirections-laravel)[ Packagist](https://packagist.org/packages/pavelzanek/redirections-laravel)[ RSS](/packages/pavelzanek-redirections-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Redirections for Laravel
========================

[](#redirections-for-laravel)

Manage your redirects easily. This package provides an easy way to integrate a redirection tool to your Laravel application.

1. [ How it works ](#howItWorks)
2. [ Installations ](#installations)
    - [ Migrations ](#migrations)
    - [ Config ](#config)
3. [ Optional ](#optional)
    - [ Views ](#views)
    - [ Translations ](#translations)
4. [ Pruning Table ](#pruningTable)
5. [ Events ](#events)
6. [ Todos ](#todos)
7. [ Testing ](#testing)
8. [ Security ](#security)
9. [ Chnagelog ](#changelog)
10. [ License ](#license)

How it works
------------

[](#how-it-works)

You can manage redirects in your Laravel application. Once installed, you can create, edit, and delete redirects without the need to install additional packages.

There is a lot of consideration for application performance. The tool caches the redirect information, specifically the source url. With each request to the server, the middleware will run, which will determine whether the requested url address is not listed in the cache. If it is found here, a query will be made to the database, which will find the target url address. Meanwhile, an event is dispatched and the associated queued event listener takes care of storing the additional redirection information.

Don't forget to run `php artisan queue:work`, `php artisan horizon` or something else what you use.

It may happen that the redirection will be unused over time, or completely unused - and records will also remain in the database. For these cases, you can schedule a command that will automatically take care of cleaning the database from unused records.

Furthermore, the tool includes functions such as easy import and export of redirects, graphs of the usability of redirects, etc.

Installations
-------------

[](#installations)

Source URLs are cached. Check if your project has `cache settings` configured. You can use from several prepared drivers (file, Redis, ...). Package also requires `PHP 8.1` at least.

### Migrations

[](#migrations)

First of all, generate and customize migration files. It can be useful, if you want to add someting (for example - some realationships).

```
php artisan vendor:publish --tag=redirections-migrations

```

### Config file

[](#config-file)

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

```

Optional
--------

[](#optional)

### Views

[](#views)

If you want to change design of the app, you can generate views. The tool contains several pre-made templates for different CSS frameworks. Now available:

- Bootstrap 4
- Bootstrap 5
- Tailwind CSS

```
php artisan vendor:publish --tag=redirections-views

```

### Translations

[](#translations)

Also you can generate translations files.

```
php artisan vendor:publish --tag=redirections-translations

```

Pruning table with redirects
----------------------------

[](#pruning-table-with-redirects)

You can prune your table with redirects. There is the command for do that:

```
php artisan redirections:prune-database

```

Alternatively you can schedule this command in your kernel file (app/Console/Kernel.php):

```
protected function schedule(Schedule $schedule)
{
    $schedule->command('redirections:prune')->dailyAt('8:00');
}

```

Events
------

[](#events)

If someone uses a redirect (that is, goes to the source URL), the `RedirectWasUsedEvent` event is fired. So you can hook your own listener if needed.

**Name****Class**RedirectWasUsedEventPavelZanek\\RedirectionsLaravel\\Events\\RedirectWasUsedEvent```
Event::listen(\PavelZanek\RedirectionsLaravel\Events\RedirectWasUsedEvent::class, function ($event) {
    dd($event->redirect);
});
```

Todos
-----

[](#todos)

- ✅ Publish the package
- ✅ List of redirects - fulltext
- ✅ List of redirects - pagination
- ✅ Disable editing Source URL
- ✅ Factory
- ✅ Add more tests
- ✅ Import / Export redirects
- ✅ Toasts / Flash Messages
- ⬜️ Regex Support
- ✅ Bootstrap 5 CSS Support
- ✅ Tailwind CSS Support
- ⬜️ More info about redirects (referer, ...)

Testing
-------

[](#testing)

The tool includes several tests for easier scalability.

Security
--------

[](#security)

If you've found a bug regarding security please mail  instead of using the issue tracker.

Changelog
---------

[](#changelog)

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

License
-------

[](#license)

Copyright (c) [Pavel Zaněk](https://pavelzanek.cz/). MIT Licensed, see [LICENSE](LICENSE.md) for details.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Total

3

Last Release

1366d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fe1587aa776b87752ccb653bfdb51be8023aa17052950994d29ea3856c67b2f?d=identicon)[zanek.pavel](/maintainers/zanek.pavel)

---

Top Contributors

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

---

Tags

laravelredirectsredirections

### Embed Badge

![Health badge](/badges/pavelzanek-redirections-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/pavelzanek-redirections-laravel/health.svg)](https://phpackages.com/packages/pavelzanek-redirections-laravel)
```

###  Alternatives

[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)[hemp/presenter

Easy Model Presenters in Laravel

247592.6k1](/packages/hemp-presenter)[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)[sirodiaz/laravel-redirection

Laravel package that allows storing in database (or other sources) urls to redirect for SEO purposes

6316.0k](/packages/sirodiaz-laravel-redirection)

PHPackages © 2026

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