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 3w 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

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

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

1817d 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

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[firefly-iii/data-importer

Firefly III Data Import Tool.

8045.8k](/packages/firefly-iii-data-importer)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[ronasit/laravel-helpers

Provided helpers function and some helper class.

2085.6k31](/packages/ronasit-laravel-helpers)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

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

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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