PHPackages                             alone-webman/domain - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. alone-webman/domain

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

alone-webman/domain
===================

中间件-域名绑定

1.0.0(11mo ago)00MITPHPPHP &gt;=8.0

Since May 29Pushed 11mo agoCompare

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

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

中间件-域名绑定
========

[](#中间件-域名绑定)

- 仅限在webman中使用

### 安装仓库

[](#安装仓库)

```
composer require alone-webman/domain

```

### 中间件方法

[](#中间件方法)

- 可以任何`config/middleware.php`中使用

```
/**
 * @param array|string $domain 域名列表 支持*.域名
 * @param Closure|null $error  不支持域名时显示内容
 */
return [
    '@' => [alone_mid_domain(array|string $domain = "", Closure|null $error = null)]
];
```

### 判断域名方法

[](#判断域名方法)

- 不使用中间件时可以使用此方法

```
/**
 * 判断域名
 * @param string       $domain 当前访问的域名
 * @param array|string $list   *=全部开放 支持*.域名
 * @param bool         $type   是否允许使用*
 * @return bool true=允许访问，false=禁止访问
*/
alone_domain(string $domain, array|string $list, bool $type = true): bool
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance50

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

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

Unknown

Total

1

Last Release

354d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c6a1452b0598af23c8cf24d868ce58f81436f9a16e487ceaa202c463c31f371?d=identicon)[zhqingphp](/maintainers/zhqingphp)

### Embed Badge

![Health badge](/badges/alone-webman-domain/health.svg)

```
[![Health](https://phpackages.com/badges/alone-webman-domain/health.svg)](https://phpackages.com/packages/alone-webman-domain)
```

###  Alternatives

[moltin/laravel-cart

Shopping cart package

27624.9k](/packages/moltin-laravel-cart)

PHPackages © 2026

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