PHPackages                             onlyoung4u/as-api - 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. [API Development](/categories/api)
4. /
5. onlyoung4u/as-api

ActiveLibrary[API Development](/categories/api)

onlyoung4u/as-api
=================

Webman plugin onlyoung4u/as-api

0.1.9(1y ago)21401MITPHPPHP &gt;=8.0

Since Oct 12Pushed 1y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (11)Versions (20)Used By (0)

as-api
======

[](#as-api)

安装
--

[](#安装)

```
composer require -W onlyoung4u/as-api
```

环境变量
----

[](#环境变量)

```
cp .env.example .env
```

获取环境变量
------

[](#获取环境变量)

```
env('key', 'default')
```

开始使用
----

[](#开始使用)

1. 修改 `config/database.php` 和 `config/redis.php` 配置
2. 执行 `php vendor/bin/phinx migrate -t 20220101000001` 创建表
3. 执行 `php vendor/bin/phinx seed:run -s AsUserSeeder` 初始化用户数据
4. 执行 `php vendor/bin/phinx seed:run -s AsMenuSeeder` 初始化菜单数据
5. 修改 `config/exception.php`

```
// 增加
'admin' => \Onlyoung4u\AsApi\Kernel\Exception\Handler::class,
'AsApi' => \Onlyoung4u\AsApi\Kernel\Exception\Handler::class,
```

迁移命令
----

[](#迁移命令)

```
# 创建
php vendor/bin/phinx create MyNewMigration

# 全部迁移
php vendor/bin/phinx migrate
# 指定迁移目标版本
php vendor/bin/phinx migrate -t 20220101000001
```

填充命令
----

[](#填充命令)

```
# 创建
php vendor/bin/phinx seed:create MyNewSeeder

# 全部填充
php vendor/bin/phinx seed:run
# 指定填充文件
php vendor/bin/phinx seed:run -s MyNewSeeder
```

处理 404
------

[](#处理-404)

> 在配置文件 config/route.php 里加上如下配置

```
Route::fallback(function () {
    return json(['code' => 404, 'msg' => '404 not found', 'data' => (object)[]]);
});
```

关闭默认路由
------

[](#关闭默认路由)

> 在配置文件 config/route.php 里最后一行加上如下配置

```
Route::disableDefaultRoute();
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

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

Every ~38 days

Recently: every ~111 days

Total

19

Last Release

611d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5aaf94ab8c10e5d05592afe62ae5d2d086935adb9533e0037518c336cffb9f2a?d=identicon)[onlyoung4u](/maintainers/onlyoung4u)

---

Top Contributors

[![onlyoung4u](https://avatars.githubusercontent.com/u/15811851?v=4)](https://github.com/onlyoung4u "onlyoung4u (17 commits)")[![MustBeBlue](https://avatars.githubusercontent.com/u/163366625?v=4)](https://github.com/MustBeBlue "MustBeBlue (3 commits)")

### Embed Badge

![Health badge](/badges/onlyoung4u-as-api/health.svg)

```
[![Health](https://phpackages.com/badges/onlyoung4u-as-api/health.svg)](https://phpackages.com/packages/onlyoung4u-as-api)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[showdoc/showdoc

ShowDoc is a tool greatly applicable for an IT team to share documents online

12.8k7.0k](/packages/showdoc-showdoc)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[saithink/saiadmin

webman plugin

2709.9k1](/packages/saithink-saiadmin)[flat3/lodata

OData v4.01 Producer for Laravel

96320.9k](/packages/flat3-lodata)

PHPackages © 2026

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