PHPackages                             spatial/mediator - 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. spatial/mediator

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

spatial/mediator
================

Simple PSR-7 PSR-15 http-server-middleware, unambitious mediator implementation in Spatial (PHP) Clean Architecture API

4.0.0(5mo ago)24531MITPHPPHP ^8.2

Since Jan 2Pushed 5mo agoCompare

[ Source](https://github.com/aiira-co/spatial-mediator)[ Packagist](https://packagist.org/packages/spatial/mediator)[ Docs](https://github.com/php-fig/http-message)[ RSS](/packages/spatial-mediator/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (8)Dependencies (2)Versions (11)Used By (1)

Spatial Mediator (http-server-middleware)
=========================================

[](#spatial-mediator-http-server-middleware)

Simple PSR-7 PSR-15 http-server-middleware, unambitious mediator implementation in Spatial (PHP) Clean Architecture API.

### Installing Mediator

[](#installing-mediator)

You should install [Mediator with Composer](https://getcomposer.org):

```
composer require spatial/mediator

```

Requires PHP 7.1 or newer.

This libray is part of the Spatial API platform using Clean Architecture. Its used to line the App's Logic from the controller, this way your Application independent on any framework.

### Usage

[](#usage)

HTTP request handlers are a fundamental part of any web application. Server-side code receives a request message, processes it, and produces a response message. HTTP middleware is a way to move common request and response processing away from the application layer.

Spatial Mediator component MAY create and return a response without delegating to a request handler, if sufficient conditions are met. If you are using Spatial WebApi Framework. then use the `mediator` to process from the controller to the main app in the Core\\Logic\\ namespace

```
