PHPackages                             amiraghaee/redirector - 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. amiraghaee/redirector

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

amiraghaee/redirector
=====================

with using this package, you can manage the header status code of routes. you can redirect or abort routes with status code.

0.1.2(4y ago)1101MITPHPPHP &gt;=7.2

Since Jul 11Pushed 4y ago1 watchersCompare

[ Source](https://github.com/AmirAghaee/Laravel-Redirector)[ Packagist](https://packagist.org/packages/amiraghaee/redirector)[ Docs](https://github.com/amiraghaee/redirector)[ RSS](/packages/amiraghaee-redirector/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Laravel Redirector
==================

[](#laravel-redirector)

with using this package, you can manage the header status code of routes. you can redirect or abort routes with status code. I try to create this package like Wordpress Yoast plugin.

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

[](#installation)

Via Composer

```
$ composer require amiraghaee/redirector
```

To adjust the package to your needs, you can publish the config file config/redirector.php to your project's config folder using:

```
$ php artisan vendor:publish --tag=redirector
```

Configurations
--------------

[](#configurations)

### Data Engine

[](#data-engine)

This package already support two data engine!

- Redis
- Eloquent

Strongly we recommend Redis database! Eloquent maybe affect to speed of your website.
Default data engine is redis, but you can change it in config/redirector.php. accepted values are 'redis' and 'eloquent'

```
'engine' => 'eloquent',
```

If you have selected the Eloquent data engine, you must run the migration command to add the "redirector" table to the database.

```
$ php artisan migrate
```

Usage
-----

[](#usage)

Use redirector namespace on top of your controller or wherever you want:

```
use AmirAghaee\Redirector\Facades\Redirector;
```

### set role:

[](#set-role)

You can add roles with this method. it will be return boolean value.

```
Redirector::set($route, $status, $endpoint);
```

#### parameters

[](#parameters)

ParameterRequiredDescriptionTyperouteyesThe source route that you want to change the header statusstringstatusyesheader status code. 300 range for redirect and 400 for abortintegerendpointNoif status code was in 300 range, request will be redirect to this routestring### get all roles:

[](#get-all-roles)

You can get all roles with this method. this method will be return collocation type value.

```
Redirector::all();
```

### get specific role:

[](#get-specific-role)

You can get specific role with this method. this method will be return collocation type value.

```
Redirector::get($route);
```

#### parameters

[](#parameters-1)

ParameterRequiredDescriptionTyperouteyesThe source route that you want getstring### delete specific role:

[](#delete-specific-role)

You can delete specific role with this method. this method will be return collocation type value.

```
Redirector::delete($route);
```

#### parameters

[](#parameters-2)

ParameterRequiredDescriptionTyperouteyesThe source route that you want getstring### fresh database:

[](#fresh-database)

You can delete all roles with this command.

```
$ php artisan redirector:refresh
```

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

TODO:
-----

[](#todo)

- Add command for fresh database!
- Add eloquent database!
- Add redis database!
- Add cache to eloquent database!

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

1761d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7da4049126a4a6eea162155bd67c7efcc52f11646f419c24124265687b622606?d=identicon)[amiraghaee](/maintainers/amiraghaee)

---

Top Contributors

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

---

Tags

laravellaravel-packagemiddlewareredirectorlaravelredirector

### Embed Badge

![Health badge](/badges/amiraghaee-redirector/health.svg)

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

###  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)[nickurt/laravel-akismet

Akismet for Laravel 11.x/12.x/13.x

97139.6k2](/packages/nickurt-laravel-akismet)[whitecube/laravel-timezones

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

106106.2k](/packages/whitecube-laravel-timezones)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[forxer/laravel-gravatar

A library providing easy gravatar integration in a Laravel project.

4235.6k](/packages/forxer-laravel-gravatar)

PHPackages © 2026

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