PHPackages                             hkinnoteam/zmiddleware - 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. hkinnoteam/zmiddleware

ActiveLibrary

hkinnoteam/zmiddleware
======================

1.0.2(5y ago)05051PHP

Since Nov 17Pushed 5y agoCompare

[ Source](https://github.com/hkinnoteam/zmidlleware)[ Packagist](https://packagist.org/packages/hkinnoteam/zmiddleware)[ RSS](/packages/hkinnoteam-zmiddleware/feed)WikiDiscussions master Synced 1mo ago

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

How to use Zmiddleware
======================

[](#how-to-use-zmiddleware)

Install
-------

[](#install)

> composer require "hkinnoteam/zmidlleware"

Implementation
--------------

[](#implementation)

- create a class which implement **ZMiddleware\\Contract\\MiddlewareInterface**

```
use ZMiddleware\Contract\MiddlewareInterface;
class AssignResultMiddleware implements MiddlewareInterface
{

    public function handle($pass, \Closure $next)
    {
        // before request
        $validate = true;
        if ($validate){
            return 'not allow';
        }

        // request method
        $number = $next($pass);

        //after request
        $number->total_qty = 100;
        return $number;
    }
}
```

Add annotation into your api method
-----------------------------------

[](#add-annotation-into-your-api-method)

```
use AssignResultMiddleware;
use ZMiddleware\Annotations\Middleware;
class Foo
{

    /**
     * single middleware
     *
     * @Middleware(AssignResultMiddleware::class)
     * @return object
     */
    public static function Foo(): object
    {
        $foo = new \stdClass();
        return $foo;
    }
}
```

> you can also assign multiple middlewares

```
use AssignBooMiddleware;
use AssignFooMiddleware;
use ZMiddleware\Annotations\Middlewares;
use ZMiddleware\Annotations\Middleware;
class Foo
{

    /**
     * multiple middlewares
     *
     * @Middlewares({
     *     @Middleware(AssignBooMiddleware::class)
     *     @Middleware(AssignFooMiddleware::class)
     * })
     * @return object
     */
    public static function Foo(): object
    {
        $foo = new \stdClass();
        return $foo;
    }
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

Total

3

Last Release

1949d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/56672404?v=4)[lllllllouis](/maintainers/Louis-Ni)[@Louis-Ni](https://github.com/Louis-Ni)

### Embed Badge

![Health badge](/badges/hkinnoteam-zmiddleware/health.svg)

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

###  Alternatives

[phpbench/phpbench

PHP Benchmarking Framework

2.0k13.0M627](/packages/phpbench-phpbench)[goaop/framework

Framework for aspect-oriented programming in PHP.

1.7k4.0M33](/packages/goaop-framework)[shopware/shopware

Shopware 5 is an open source e-commerce software made in Germany

1.3k746.6k35](/packages/shopware-shopware)[doctrine/doctrine-module

Laminas Module that provides Doctrine basic functionality required for ORM and ODM modules

3957.9M115](/packages/doctrine-doctrine-module)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[akeneo/pim-community-dev

Akeneo PIM, the future of catalog management is open!

1.0k614.1k80](/packages/akeneo-pim-community-dev)

PHPackages © 2026

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