PHPackages                             k2tzumi/laravel-coverage-middleware - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. k2tzumi/laravel-coverage-middleware

ActiveLibrary[Testing &amp; Quality](/categories/testing)

k2tzumi/laravel-coverage-middleware
===================================

HTTP middleware to get code coverage of Laravel applications on remote servers

0.0.7(1y ago)021MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Jan 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/k2tzumi/laravel-coverage-middleware)[ Packagist](https://packagist.org/packages/k2tzumi/laravel-coverage-middleware)[ RSS](/packages/k2tzumi-laravel-coverage-middleware/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (6)Versions (17)Used By (0)

[![test passsed](https://github.com/k2tzumi/laravel-coverage-middleware/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/k2tzumi/laravel-coverage-middleware/actions/workflows/test.yml/badge.svg?branch=main)

laravel-coverage-middleware
===========================

[](#laravel-coverage-middleware)

HTTP middleware to get code coverage of Laravel applications on remote servers

Introduction
------------

[](#introduction)

The laravel-coverage-middleware library is designed to help developers obtain code coverage when performing API tests on remote Laravel applications. The library provides a middleware that can be used to collect code coverage data during API tests, which can then be used to generate reports and identify areas of the codebase that require further testing.

Requirements
------------

[](#requirements)

Here are the environment requirements for laravel-coverage-middleware:

- [PHP](https://www.php.net/)
    Version 8.2 or higher.
- [Laravel](https://laravel.com/)
    Version 9.0 or higher.
- [PHPUnit](https://github.com/sebastianbergmann/phpunit)
    Version 9.0 or higher.
- [runn](https://github.com/k1LoW/runn)
    Version 0.93.0 or higher.

Installation
------------

[](#installation)

Here are the steps to install laravel-coverage-middleware:

1. Run the following command to install the library as a development dependency

```
composer require --dev k2tzumi/laravel-coverage-middleware
```

2. Run the following command to publish the configuration file of the library:

```
php artisan vendor:publish --provider="K2tzumi\LaravelCoverageMiddleware\Providers\CoverageServiceProvider"
```

3. Run the following command to install the coverage middleware:

```
php artisan coverage:install {group}
```

Please replace `group` with the name of the middleware group that you want to include in the coverage report.

Usage
-----

[](#usage)

Here are the steps to use laravel-coverage-middleware:

1. Once the library is installed, start the Laravel application, enable httpRunner tracing in [runn](https://github.com/k1LoW/runn), and run the API test.
2. The coverage data will be collected during the API tests and stored in the storage/coverage directory.
3. You can use phpcov to generate HTML reports from the coverage files and view them to identify areas of the codebase that require further testing.

Configuration
-------------

[](#configuration)

After installing laravel-coverage-middleware, you can edit the config/coverage.php file to configure the library. The following are the available configuration options:

- phpunit\_config\_path(default: `phpunit.xml`)
    Specifies the path to the PHPUnit configuration file. The coverage data collected by the library will be based on the source settings in this configuration file.
- runn-trace-header(default: `X-Runn-Trace`)
    Specifies the trace header for httpRunner. If you are not using runn, you can specify the name of the request header that contains the trace information for your tool.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance50

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.7% 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 ~87 days

Recently: every ~130 days

Total

7

Last Release

367d ago

PHP version history (2 changes)0.0.1PHP ^8.2|^8.3

0.0.7PHP ^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a0743b2d25b17fc0cb3564dabd7db89b77541053c4302c76542459e6a8863e93?d=identicon)[k2tzumi](/maintainers/k2tzumi)

---

Top Contributors

[![k2tzumi](https://avatars.githubusercontent.com/u/1182787?v=4)](https://github.com/k2tzumi "k2tzumi (110 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (14 commits)")

---

Tags

laravel-middleware

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/k2tzumi-laravel-coverage-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/k2tzumi-laravel-coverage-middleware/health.svg)](https://phpackages.com/packages/k2tzumi-laravel-coverage-middleware)
```

###  Alternatives

[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k42.5M40.7k](/packages/orchestra-testbench)[brianium/paratest

Parallel testing for PHP

2.5k136.1M984](/packages/brianium-paratest)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M341](/packages/drupal-core-dev)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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