PHPackages                             softonic/laravel-psr15-bridge - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. softonic/laravel-psr15-bridge

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

softonic/laravel-psr15-bridge
=============================

Laravel PSR-15 middleware bridge

5.0.0(4mo ago)9106.5k↓12.1%8[1 PRs](https://github.com/softonic/laravel-psr15-bridge/pulls)Apache-2.0PHPPHP &gt;=8.5CI passing

Since Jan 28Pushed 4mo ago5 watchersCompare

[ Source](https://github.com/softonic/laravel-psr15-bridge)[ Packagist](https://packagist.org/packages/softonic/laravel-psr15-bridge)[ Docs](https://github.com/softonic/laravel-psr15-bridge)[ RSS](/packages/softonic-laravel-psr15-bridge/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (12)Used By (0)

Laravel PSR-15 Middleware Bridge
================================

[](#laravel-psr-15-middleware-bridge)

[![Latest Version](https://camo.githubusercontent.com/3f274f6257b258599800470ab88ac16cfe29e99d988345106c668e1a9b48a6ce/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f736f66746f6e69632f6c61726176656c2d70737231352d6272696467652e7376673f7374796c653d666c61742d737175617265)](https://github.com/softonic/laravel-psr15-bridge/releases)[![Software License](https://camo.githubusercontent.com/36cfc741510e076bec951c1421a2b1c3a5553e953fcdb378339626a5f33c1e8d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/d1f4f474fdc5d93919042472f301ec03694517527db0d5219b982aa08b98783c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f66746f6e69632f6c61726176656c2d70737231352d6272696467652f74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/softonic/laravel-psr15-bridge/actions)[![Total Downloads](https://camo.githubusercontent.com/7f867933a4b5edf1c271ed0a2205dfc0b5afdfb2ba8c70d1b76123dda7c7bc56/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f66746f6e69632f6c61726176656c2d70737231352d6272696467652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/softonic/laravel-psr15-bridge)

This package provides a Laravel middleware bridge for [PSR-15](https://www.php-fig.org/psr/psr-15/) inspired in [jshannon63/laravel-psr15-middleware](https://github.com/jshannon63/laravel-psr15-middleware).

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

[](#requirements)

- PHP &gt;= 8.5
- Laravel 12.x

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

[](#installation)

To install, use composer:

```
composer require softonic/laravel-psr15-bridge

```

You are ready to use it!

Usage
-----

[](#usage)

The bridge adapter receive a [PSR-15](https://www.php-fig.org/psr/psr-15/) middleware via injection, so the bridge is transparent for Laravel and you can use it as any other middleware.

Example based on [OpenApi Validation Middleware](https://github.com/hkarlstrom/openapi-validation-middleware):

Wrapping [OpenApi Validation Middleware](https://github.com/hkarlstrom/openapi-validation-middleware) within the bridge.

```
// app/Providers/AppServiceProvider.php

use Softonic\Laravel\Middleware\Psr15Bridge\Psr15MiddlewareAdapter;

/**
 * Register any application services.
 *
 * @return void
 */
public function register()
{
    $this->app->bind(OpenApiValidation::class, function () {

        // Setup your PSR-15 middleware here
        $validator = new \HKarlstrom\Middleware\OpenApiValidation('schema.json');

        // Return it wrapped in the adapter to make Laravel accept it
        return Psr15MiddlewareAdapter::adapt($validator);
    });
}
```

Now you can use it anywhere or for example generate an alias.

```
// app/Http/Kernel.php

protected $routeMiddleware = [
    ...
    'openapi-validation' => OpenApiValidation::class,
];
```

Check [laravel middleware](https://laravel.com/docs/12.x/middleware) for more information.

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

[](#how-it-works)

In the next diagram you can see the request and response flow.

[![psr-15 bridge flow](doc/bridge_flow.png)](doc/bridge_flow.png)

As you can see, when you execute `Psr15MiddlewareAdapter::adapt($validator);`, you are adding an envelop to the PSR-15 middleware that converts the request and response transparently for the middleware format Laravel expects.

Testing
-------

[](#testing)

`softonic/laravel-psr15-bridge` has a [PHPUnit](https://phpunit.de) test suite and a coding style compliance test suite using [PHP CS Fixer](https://cs.symfony.com/).

To run the tests, run the following command from the project folder.

```
$ docker compose run --rm test
```

To run PHPUnit only:

```
$ docker compose run --rm phpunit
```

To check code style:

```
$ docker compose run --rm php composer run phpcs
```

To fix code style issues:

```
$ docker compose run --rm fixcs
```

License
-------

[](#license)

The Apache 2.0 license. Please see [LICENSE](LICENSE) for more information.

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance77

Regular maintenance activity

Popularity40

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor3

3 contributors hold 50%+ of commits

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

Recently: every ~308 days

Total

11

Last Release

126d ago

Major Versions

1.4.0 → 2.0.02020-11-02

2.0.0 → 3.0.02022-08-29

3.0.0 → 4.0.02023-09-26

4.1.1 → 5.0.02026-01-12

PHP version history (4 changes)1.0.0PHP &gt;=7.1

2.0.0PHP &gt;=7.3

4.0.0PHP &gt;=8.1

5.0.0PHP &gt;=8.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/524887?v=4)[Joskfg](/maintainers/Joskfg)[@joskfg](https://github.com/joskfg)

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

---

Top Contributors

[![joskfg](https://avatars.githubusercontent.com/u/524887?v=4)](https://github.com/joskfg "joskfg (5 commits)")[![philsturgeon](https://avatars.githubusercontent.com/u/67381?v=4)](https://github.com/philsturgeon "philsturgeon (2 commits)")[![xaviapa](https://avatars.githubusercontent.com/u/8439057?v=4)](https://github.com/xaviapa "xaviapa (2 commits)")[![josemanuel-cardona](https://avatars.githubusercontent.com/u/196229448?v=4)](https://github.com/josemanuel-cardona "josemanuel-cardona (2 commits)")[![giggsey](https://avatars.githubusercontent.com/u/305730?v=4)](https://github.com/giggsey "giggsey (1 commits)")[![xendk](https://avatars.githubusercontent.com/u/229422?v=4)](https://github.com/xendk "xendk (1 commits)")[![Ilyes512](https://avatars.githubusercontent.com/u/2445415?v=4)](https://github.com/Ilyes512 "Ilyes512 (1 commits)")[![Lotykun-Softonic](https://avatars.githubusercontent.com/u/130476160?v=4)](https://github.com/Lotykun-Softonic "Lotykun-Softonic (1 commits)")[![Techworker](https://avatars.githubusercontent.com/u/789017?v=4)](https://github.com/Techworker "Techworker (1 commits)")

---

Tags

laravelpsr-15psrmiddlewarelaravel

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/softonic-laravel-psr15-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/softonic-laravel-psr15-bridge/health.svg)](https://phpackages.com/packages/softonic-laravel-psr15-bridge)
```

###  Alternatives

[kirschbaum-development/laravel-openapi-validator

Automatic OpenAPI validation for Laravel HTTP tests

581.1M5](/packages/kirschbaum-development-laravel-openapi-validator)[jshannon63/laravel-psr15-middleware

Allows the Use of PSR-15 Compliant Middleware in Laravel

134.2k](/packages/jshannon63-laravel-psr15-middleware)

PHPackages © 2026

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