PHPackages                             laniakea/middleware-priority - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. laniakea/middleware-priority

ActiveLibrary[HTTP &amp; Networking](/categories/http)

laniakea/middleware-priority
============================

More flexible way to manage Laravel's HTTP middleware priority.

v1.1.0(1y ago)4360[1 PRs](https://github.com/tzurbaev/laravel-middleware-priority/pulls)MITPHPPHP ^8.2

Since Mar 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tzurbaev/laravel-middleware-priority)[ Packagist](https://packagist.org/packages/laniakea/middleware-priority)[ Docs](https://github.com/tzurbaev/laravel-middleware-priority)[ GitHub Sponsors](https://github.com/tzurbaev)[ RSS](/packages/laniakea-middleware-priority/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

Middleware priority manager for Laravel 11 &amp; 12
===================================================

[](#middleware-priority-manager-for-laravel-11--12)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ec06088f64d81440459b982456e843ee81f006dbe30b2e4e1d49e83079e0d675/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c616e69616b65612f6d6964646c65776172652d7072696f726974792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laniakea/middleware-priority)[![Tests](https://camo.githubusercontent.com/aec45f1008ef776e3a80e3d2a32825941214381e162f535a576f2c19aaa47172/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f747a7572626165762f6c61726176656c2d6d6964646c65776172652d7072696f726974792f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/tzurbaev/laravel-middleware-priority/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/e67c2932ef8b92038be681a6dfbf1e88fd396526a2312d7f66e1a95b36634ad3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c616e69616b65612f6d6964646c65776172652d7072696f726974792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laniakea/middleware-priority)

This package provides more flexible way to manage HTTP middleware priority in Laravel 11 &amp; 12 applications.

> Please note that this package only compatible with fresh Laravel 11/12 applications (or applications that have been upgraded to Laravel 11/12 with new directory structure / application bootstrapping).

You can simply append/prepend your middleware to the priority list or do more complex things, such as:

- Add your middleware before or after specific middleware;
- Swap positions of two middleware;
- Remove middleware from the priority list.

This package provides default Laravel's priority list (latest update: Laravel 12.0.1; check `DefaultMiddlewarePriority` class), so you can use it as a base for your custom priority list.

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

[](#installation)

You can install the package via composer:

```
composer require laniakea/middleware-priority
```

Usage
-----

[](#usage)

This package is intended to be used with Laravel's `Application::configure()` builder (located in `bootstrap/app.php` file).

```
