PHPackages                             alicfeng/laravel-runtime - 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. alicfeng/laravel-runtime

ActiveLibrary[API Development](/categories/api)

alicfeng/laravel-runtime
========================

Laravel Runtime Library

v1.0(7y ago)97352[2 issues](https://github.com/alicfeng/laravel-runtime/issues)MITPHP

Since Mar 21Pushed 6y agoCompare

[ Source](https://github.com/alicfeng/laravel-runtime)[ Packagist](https://packagist.org/packages/alicfeng/laravel-runtime)[ RSS](/packages/alicfeng-laravel-runtime/feed)WikiDiscussions master Synced yesterday

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

[](#)

 [ Laravel Runtime ](https://github.com/alicfeng/laravel-runtime)
=================================================================

[](#------------laravel-runtime----)

 laravel-runtime features for Laravel Application [![](https://raw.githubusercontent.com/alicfeng/laravel-runtime/master/file/runtime.jpg)](https://raw.githubusercontent.com/alicfeng/laravel-runtime/master/file/runtime.jpg)

 [ ![Latest Stable Version](https://camo.githubusercontent.com/40d22d3a364b2d97c1abc0208a044957c0624950e61e51d3cbe3deebb10282ab/68747470733a2f2f706f7365722e707567782e6f72672f616c696366656e672f6c61726176656c2d72756e74696d652f762f737461626c652e737667) ](https://packagist.org/packages/alicfeng/laravel-runtime) [ ![Total Downloads](https://camo.githubusercontent.com/e8c49f081ef869bda11617d256ad1831e32ae44c6d9fff9a6324baea34773fb4/68747470733a2f2f706f7365722e707567782e6f72672f616c696366656e672f6c61726176656c2d72756e74696d652f642f746f74616c2e737667) ](https://packagist.org/packages/alicfeng/laravel-runtime) [ ![License](https://camo.githubusercontent.com/5c41bbbec61969f0193d6cb465a709e95cb614ed6eca81ab2c7d4a46d4407b90/68747470733a2f2f706f7365722e707567782e6f72672f616c696366656e672f6c61726176656c2d72756e74696d652f6c6963656e73652e737667) ](https://packagist.org/packages/alicfeng/laravel-runtime)

[](https://github.styleci.io/repos/127536154)
=============================================

#### 前言

[](#前言)

`laravel-runtime`此项目为`Laravel`中的插件

无论在开发、测试还是生产环境中，我们皆比较注重请求的数据，一般的做法是将有价值的数据写入在日志当中，便于调试、问题排查等，在`Request`到达控制器前处理数据信息的写入，在此使用`Http`中间件拦截处理，即在请求在中间件中做**日志记载**。

同时、在开发以及测试的时候，一个合格的开发者总是会关注其接口是否存在性能上的问题，比如接口请求的时间消耗多少等，此插件可以通过`CLI`模式在终端以表格的形式展示接口的基本状况，`web`端界面亦可以简约展示，如下图所示

- `CLI终端`

[![runtime-cli](https://raw.githubusercontent.com/alicfeng/laravel-runtime/master/file/runtime.jpg)](https://raw.githubusercontent.com/alicfeng/laravel-runtime/master/file/runtime.jpg)

- `WEB端`

[![runtime-web](https://raw.githubusercontent.com/alicfeng/laravel-runtime/master/file/web.png)](https://raw.githubusercontent.com/alicfeng/laravel-runtime/master/file/web.png)

#### 功能

[](#功能)

- 接口请求的核心数据日志记载
- 接口请求记录分析

#### 环境要求

[](#环境要求)

- `PHP`&gt;=7.0
- `composer`
- `laravel`

#### 安装

[](#安装)

```
composer require "alicfeng/laravel-runtime"
```

#### 配置

[](#配置)

- 在`config/app.php`配置中添加

    ```
    AlicFeng\Runtime\ServiceProvider\RuntimeServiceProvider::class
    ```
- 在`app/Http/Kernel.php`中添加中间件

    ```
    \AlicFeng\Runtime\Middleware\RuntimeMiddleware::class
    ```
- 生成配置文件

    ```
    php artisan vendor:publish --provider="AlicFeng\Runtime\ServiceProvider\RuntimeServiceProvider"
    ```

#### 使用

[](#使用)

- `CLI`

```
#使用帮助
➜ php artisan samego:runtime help
usage:
php artisan samego:runtime [help] [--service {reload|analysis}] [--start] [--end]

# 查看接口请求情况分析(支持时间段)
➜ php artisan samego:runtime --service=analysis
➜ php artisan samego:runtime --service=analysis --start={opition|strtotime|0}
➜ php artisan samego:runtime --service=analysis --end={opition|strtotime|time()}

# 分析数据重载
➜ php artisan samego:runtime --service=reload
```

- `WEB`

浏览器打开`$host/runtime/analysis`即可看到展示~

#### tail日志

[](#tail日志)

```
➜ tail -f storage/logs/laravel-2019-04-24.log
[2019-04-24 11:38:44] production.INFO: trace request message begin
[2019-04-24 11:38:44] production.INFO: router  : order/v1/interface/name
[2019-04-24 11:38:44] production.INFO: method  : POST
[2019-04-24 11:38:44] production.INFO: ip      : 113.118.235.220
[2019-04-24 11:38:44] production.INFO: params  : {"header":{"userToken":"token"},"body":{"param":"alicfeng"}
[2019-04-24 11:38:44] production.INFO: trace request message end
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

2610d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/03b1b279fc8884dc96482b6cd25c7a28877b0f3223de52987651de8917da1ed4?d=identicon)[alicfeng](/maintainers/alicfeng)

---

Top Contributors

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

---

Tags

analysisapilaravelruntimelaravelruntimealicfengsamegolaravel-runtime

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alicfeng-laravel-runtime/health.svg)

```
[![Health](https://phpackages.com/badges/alicfeng-laravel-runtime/health.svg)](https://phpackages.com/packages/alicfeng-laravel-runtime)
```

###  Alternatives

[rakibdevs/openweather-laravel-api

Laravel package to connect https://openweathermap.org/ to get customized weather data for any location on the globe immediately

7648.2k](/packages/rakibdevs-openweather-laravel-api)

PHPackages © 2026

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