PHPackages                             indragunawan/middleware-bundle - 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. [Framework](/categories/framework)
4. /
5. indragunawan/middleware-bundle

ActiveSymfony-bundle[Framework](/categories/framework)

indragunawan/middleware-bundle
==============================

Before and After filter implementation by using annotation

0261[1 PRs](https://github.com/IndraGunawan/middleware-bundle/pulls)PHP

Since Nov 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/IndraGunawan/middleware-bundle)[ Packagist](https://packagist.org/packages/indragunawan/middleware-bundle)[ RSS](/packages/indragunawan-middleware-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

MiddlewareBundle
================

[](#middlewarebundle)

[![license](https://camo.githubusercontent.com/0e4abed7f0bfa3a4688566de270a9b54f7ea8adaa82baa4b382fd72ad91d1f1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f496e64726147756e6177616e2f6d6964646c65776172652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/IndraGunawan/middleware-bundle/blob/master/LICENSE.md)[![Travis](https://camo.githubusercontent.com/e98c0db8b0e7d4fe1c85ce5a235e4ad0a9a6c38179d8319ed94031394d1eca71/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f496e64726147756e6177616e2f6d6964646c65776172652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/IndraGunawan/middleware-bundle)[![Scrutinizer Coverage](https://camo.githubusercontent.com/9a38751e4b6423109f4c4dbac3b554f10358717bbe9581109d19c24671946949/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f496e64726147756e6177616e2f6d6964646c65776172652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/IndraGunawan/middleware-bundle/?branch=master)[![Scrutinizer](https://camo.githubusercontent.com/e14c792085b71a9d497a1818a79e9d1538be1250d5e74118f1d2ece6b93541bb/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f496e64726147756e6177616e2f6d6964646c65776172652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/IndraGunawan/middleware-bundle/?branch=master)[![Source](https://camo.githubusercontent.com/0a5d6acfe4356a0d700d3fac28246e79261e6c00383088467d8881de7b453b0b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d496e64726147756e6177616e2532466d6964646c65776172652d2d62756e646c652d626c75652e737667)](https://github.com/IndraGunawan/middleware-bundle)[![Packagist](https://camo.githubusercontent.com/f77e97b2d6a0ffb03d35e2627469256d3627649c1c8c84a2ed7ab12e76e06fce/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d696e64726167756e6177616e2532466d6964646c65776172652d2d62756e646c652d626c75652e737667)](https://packagist.org/packages/indragunawan/middleware-bundle)

Middleware bundle provide simple implementation of [symfony before and after filter](https://symfony.com/doc/current/event_dispatcher/before_after_filters.html) by using annotation. this implementation is inspired by Laravel Middleware.

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

[](#installation)

If your project already uses Symfony Flex, execute this command to download, register and configure the bundle automatically:

```
composer require indragunawan/middleware-bundle
```

If you install without using Symfony Flex, first add the bundle by using composer then enable the bundle by adding `new Indragunawan\MiddlewareBundle\IndragunawanMiddlewareBundle()` to the list of registered bundles in the app/AppKernel.php file of your project.

Create middleware service
-------------------------

[](#create-middleware-service)

```
