PHPackages                             sunxyw/policy - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. sunxyw/policy

AbandonedArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

sunxyw/policy
=============

v1.0.0(4y ago)16PHP

Since Mar 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/sunxyw/zm-policy)[ Packagist](https://packagist.org/packages/sunxyw/policy)[ RSS](/packages/sunxyw-policy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

zm-policy
=========

[](#zm-policy)

一个非常简单的，用于炸毛框架的基础权限控制库。

使用方法
----

[](#使用方法)

```
composer require sunxyw/policy
```

在 `OnStart` 方法中：

```
#[OnStart]
public function init()
{
    \Sunxyw\Policy\Gate::define('can_view_timer', static function ($params) {
        return false;
    });
}
```

```
use Sunxyw\Policy\Annotations\Gate;

#[CQCommand('view_timer')]
#[Gate('can_view_timer', 'any_param_here')]
public function timer()
{
    return 'This page is used as testing TimerMiddleware! Do not use it in production.';
}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1518d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0074b4d8ef244d2d516e67fe7949e287b37eeee02d4adfa0da953077bf7e0121?d=identicon)[sunxyw](/maintainers/sunxyw)

---

Top Contributors

[![sunxyw](https://avatars.githubusercontent.com/u/31698606?v=4)](https://github.com/sunxyw "sunxyw (4 commits)")

---

Tags

zhamao-module

### Embed Badge

![Health badge](/badges/sunxyw-policy/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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