PHPackages                             boltci/shards - 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. boltci/shards

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

boltci/shards
=============

Patch PHPUnit and Paratest to shard your Laravel test suite.

v0.1.2(6mo ago)43.9k↓18.6%MITPHPPHP ^8.2CI passing

Since Dec 7Pushed 6mo agoCompare

[ Source](https://github.com/boltci/shards)[ Packagist](https://packagist.org/packages/boltci/shards)[ RSS](/packages/boltci-shards/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

Shards
======

[](#shards)

[![Unit Tests](https://github.com/boltci/shards/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/boltci/shards/actions/workflows/unit-tests.yml)[![Integration Tests](https://github.com/boltci/shards/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/boltci/shards/actions/workflows/integration-tests.yml)

Patch PHPUnit and Paratest to shard your Laravel test suite.

Caveats
-------

[](#caveats)

Both [Pest](https://github.com/pestphp/pest/) (as of [version 4.0.0](https://github.com/pestphp/pest/releases/tag/v4.0.0)) and [ParaTest](https://github.com/paratestphp/paratest) (as of [version 7.13.0](https://github.com/paratestphp/paratest/releases/tag/v7.13.0)) support test sharding natively, in more robust ways than this package provides.

You should only use this as a last resort if your version of testing framework does not support sharding natively.

Supported Versions
------------------

[](#supported-versions)

- PHP 8.2 or higher
- Laravel 10.x or higher
- PHPUnit 10.x or higher
- ParaTest 7.2.0 or higher

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

[](#installation)

Install the package via Composer:

```
composer require boltci/shards --dev
```

Usage
-----

[](#usage)

### 1. Patch PHPUnit

[](#1-patch-phpunit)

Before running your tests, patch PHPUnit to enable sharding:

```
php artisan shards:patch-phpunit
```

This command modifies the PHPUnit test suite builder to shard tests based on your environment configuration.

### 2. Patch ParaTest

[](#2-patch-paratest)

If you're using ParaTest versions between 7.2.0 and 7.4.2, you may need to apply a compatibility patch:

```
php artisan shards:patch-paratest
```

**Note**: ParaTest 7.4.3 and above have the issue fixed and don't require patching.

### 3. Run Your Tests

[](#3-run-your-tests)

Run your tests with the `SHARD` environment variable set to specify which shard to run. The format is `x/y`, where `x` is the shard number and `y` is the total number of shards.

```
SHARD=1/5 php artisan test
```

You can optionally set the `SEED` variable to any positive integers to shuffle the test order using a deterministic seed (i.e. the same seed will always produce the same test order):

```
SHARD=1/5 SEED=1 php artisan test
```

When using ParaTest (by passing `--parallel`), include the `--functional` flag to parallelize by Test to avoid overlaps between shards:

```
SHARD=1/5 SEED=1 php artisan test --parallel --functional
```

This is useful to help distribute tests more evenly across shards.

Credits
-------

[](#credits)

- The first version of this code was first written for internal use at [Springloaded](https://springloaded.co).
- The use of the word "shard" and the "x/y" shard notation was later adapted from [Pest](https://pestphp.com/docs/4.x/sharding).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance66

Regular maintenance activity

Popularity27

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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

Every ~2 days

Total

3

Last Release

204d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4dd4c3943583b0db4572b8702f3ee8f85a3fa7ecf99401d5f1add6613821f031?d=identicon)[matt-daneshvar](/maintainers/matt-daneshvar)

---

Top Contributors

[![matt-daneshvar](https://avatars.githubusercontent.com/u/10030505?v=4)](https://github.com/matt-daneshvar "matt-daneshvar (17 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/boltci-shards/health.svg)

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M130](/packages/roots-acorn)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M150](/packages/laravel-mcp)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725172.4k14](/packages/tallstackui-tallstackui)

PHPackages © 2026

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