PHPackages                             middlewares/lowercase - 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. middlewares/lowercase

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

middlewares/lowercase
=====================

A lowercase repository for PSR-15 middleware packages

v1.1.0(1y ago)135.7kMITPHPPHP ^7.2 || ^8.0CI passing

Since Apr 8Pushed 1y ago2 watchersCompare

[ Source](https://github.com/middlewares/lowercase)[ Packagist](https://packagist.org/packages/middlewares/lowercase)[ Docs](https://github.com/middlewares/lowercase)[ RSS](/packages/middlewares-lowercase/feed)WikiDiscussions master Synced 1w ago

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

middlewares/lowercase
=====================

[](#middlewareslowercase)

[![Latest Version on Packagist](https://camo.githubusercontent.com/20a60c8524d026a407cb80b0b3095178616cad205421ce82fbed24fe7465eccc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6964646c6577617265732f6c6f776572636173652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/middlewares/lowercase)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Testing](https://github.com/middlewares/minifier/workflows/testing/badge.svg)](https://github.com/middlewares/minifier/workflows/testing/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/95176243acc8bd321606734b053f95de5c6c7a71893f93a66b0c35144a61fd0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6964646c6577617265732f6c6f776572636173652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/middlewares/lowercase)

Middleware to set the uri path to lowercase. For example, `/Foo/Bar/` is converted to `/foo/bar`. Useful if you define your routes as lowercase and want to make your routes case insensitive.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2
- A [PSR-7 http library](https://github.com/middlewares/awesome-psr15-middlewares#psr-7-implementations)
- A [PSR-15 middleware dispatcher](https://github.com/middlewares/awesome-psr15-middlewares#dispatcher)

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

[](#installation)

This package is installable and autoloadable via Composer as [middlewares/lowercase](https://packagist.org/packages/middlewares/lowercase).

```
composer require middlewares/lowercase
```

Example
-------

[](#example)

```
$dispatcher = new Dispatcher([
    (new Middlewares\Lowercase())
        ->redirect()
        ->attribute('before-lowercase-uri')
]);

$response = $dispatcher->dispatch(new ServerRequest());
```

Usage
-----

[](#usage)

### redirect

[](#redirect)

If the path must be converted to lowercase, this option returns a 301 response redirecting to the new lowercase path. Optionally, you can provide a Psr\\Http\\Message\\ResponseFactoryInterface that will be used to create the redirect response. If it's not defined, Middleware\\Utils\\Factory will be used to detect it automatically.

```
$responseFactory = new MyOwnResponseFactory();

//Simply set the path to lowercase
$lowercase = new Middlewares\Lowercase();

//Returns a redirect response to the new path
$lowercase = (new Middlewares\Lowercase())->redirect();

//Returns a redirect response to the new path using a specific response factory
$lowercase = (new Middlewares\Lowercase())->redirect($responseFactory);
```

### attribute

[](#attribute)

If the path must be converted to lowercase, this method will store the original path in an atrribute.

```
// Save the original non-lowercase uri in the custom attribute "pre-lowercase-path"
$lowercase = (new Middlewares\Lowercase())->attribute('before-lowercase-uri');
```

---

Please see [CHANGELOG](CHANGELOG.md) for more information about recent changes and [CONTRIBUTING](CONTRIBUTING.md) for contributing details.

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance46

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~1443 days

Total

2

Last Release

421d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e99df56b617f4af8cf0556a51a0ca20c7420104920c57d7e9eab093f92bb744f?d=identicon)[oscarotero](/maintainers/oscarotero)

![](https://www.gravatar.com/avatar/42e0d72f42eb7d84f67e20d28606da42e5a3248ca908b1eadb4366aafeae2561?d=identicon)[filisko](/maintainers/filisko)

---

Top Contributors

[![oscarotero](https://avatars.githubusercontent.com/u/377873?v=4)](https://github.com/oscarotero "oscarotero (5 commits)")[![filisko](https://avatars.githubusercontent.com/u/8798694?v=4)](https://github.com/filisko "filisko (2 commits)")

---

Tags

httppsr-7middlewareserverpsr-15

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/middlewares-lowercase/health.svg)

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

###  Alternatives

[middlewares/request-handler

Middleware to execute request handlers

451.6M26](/packages/middlewares-request-handler)[middlewares/fast-route

Middleware to use FastRoute

96191.1k15](/packages/middlewares-fast-route)[middlewares/negotiation

Middleware to implement content negotiation

47442.1k11](/packages/middlewares-negotiation)[middlewares/payload

Middleware to parse the body of the request with support for json, csv and url-encode

32466.8k17](/packages/middlewares-payload)[middlewares/http-authentication

Middleware to implement Basic and Digest Http authentication

35302.0k2](/packages/middlewares-http-authentication)[middlewares/client-ip

Middleware to detect the client ip and save it as a request attribute

16629.7k9](/packages/middlewares-client-ip)

PHPackages © 2026

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