PHPackages                             tienvx/laravel-pact-provider - 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. tienvx/laravel-pact-provider

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

tienvx/laravel-pact-provider
============================

Pact Provider integration for Laravel

v0.2.0(2y ago)11.5kMITPHPPHP ^8.1

Since Apr 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/tienvx/laravel-pact-provider)[ Packagist](https://packagist.org/packages/tienvx/laravel-pact-provider)[ RSS](/packages/tienvx-laravel-pact-provider/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (3)Used By (0)

Pact Provider Package [![Build Status](https://github.com/tienvx/laravel-pact-provider/workflows/main/badge.svg)](https://github.com/tienvx/laravel-pact-provider/actions) [![Coverage Status](https://camo.githubusercontent.com/57cf2d0b8c4e9f2219f8a01ac4008ced62e903fae685698435c7b0086b1e1b24/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7469656e76782f6c61726176656c2d706163742d70726f76696465722f62616467652e7376673f6272616e63683d6d61696e26736572766963653d676974687562)](https://coveralls.io/github/tienvx/laravel-pact-provider?branch=main) [![Version](https://camo.githubusercontent.com/3df6fd019b30826563c5db3367416b2d8edbc3b6467e8bad23e91fb82cb40bb7/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7469656e76782f6c61726176656c2d706163742d70726f76696465722e7376673f7374796c653d666c6174)](https://packagist.org/packages/tienvx/laravel-pact-provider) [![PHP Version](https://camo.githubusercontent.com/d0940d9652b353227d92a43a0aa221f2ee3a317a7e29a2cb1af6013a18a9d922/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e312e302b2d6666363962342e737667)](https://packagist.org/packages/tienvx/laravel-pact-provider)
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#pact-provider-package----)

This Laravel Package allow testing Laravel project with [Pact PHP](https://github.com/pact-foundation/pact-php). It support:

- Verify sending messages
- Set up provider state
- Tear down provider state

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

[](#installation)

```
composer require tienvx/laravel-pact-provider
```

Documentation
-------------

[](#documentation)

### Register State Handler

[](#register-state-handler)

```
namespace App\StateHandler;

use Tienvx\PactProvider\Attribute\AsStateHandler;
use Tienvx\PactProvider\Model\StateValues;
use Tienvx\PactProvider\StateHandler\SetUpInterface;
use Tienvx\PactProvider\StateHandler\TearDownInterface;

#[AsStateHandler(state: 'A user with id dcd79453-7346-4423-ae6e-127c60d8dd20 exists')]
class UserHandler implements SetUpInterface, TearDownInterface
{
    public function setUp(array $params): ?StateValues
    {
        return new StateValues([
            'id' => 123,
        ]);
    }

    public function tearDown(array $params): void
    {
    }
}
```

```
app()->bind(UserHandler::class);
```

### Register Message Dispatcher

[](#register-message-dispatcher)

```
namespace App\MessageDispatcher;

use Tienvx\PactProvider\Attribute\AsMessageDispatcher;
use Tienvx\PactProvider\Model\Message;
use Tienvx\PactProvider\MessageDispatcher\DispatcherInterface;

#[AsMessageDispatcher(description: 'User created message')]
class UserDispatcher implements DispatcherInterface
{
    public function dispatch(): ?Message
    {
    }
}
```

```
app()->bind(UserDispatcher::class);
```

License
-------

[](#license)

[MIT](https://github.com/tienvx/laravel-pact-provider/blob/main/LICENSE)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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 ~0 days

Total

2

Last Release

771d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/176d0199776bb6cdb210e2c5339ec79637c613e0617377378807bfe051eabb8e?d=identicon)[tien.xuan.vo](/maintainers/tien.xuan.vo)

---

Top Contributors

[![tienvx](https://avatars.githubusercontent.com/u/3327643?v=4)](https://github.com/tienvx "tienvx (23 commits)")

---

Tags

laravelpactcontract-testingconsumer-driven-contract-testing

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/tienvx-laravel-pact-provider/health.svg)

```
[![Health](https://phpackages.com/badges/tienvx-laravel-pact-provider/health.svg)](https://phpackages.com/packages/tienvx-laravel-pact-provider)
```

###  Alternatives

[larastan/larastan

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

6.4k43.5M5.2k](/packages/larastan-larastan)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

71510.9M66](/packages/laravel-mcp)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[galahad/laravel-addressing

Laravel package providing addressing functionality

70316.6k](/packages/galahad-laravel-addressing)

PHPackages © 2026

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