PHPackages                             code-distortion/adapt - 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. code-distortion/adapt

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

code-distortion/adapt
=====================

A Laravel package that builds databases for your tests, improving their speed.

0.12.15(9mo ago)2835.5k↓39.7%5[5 issues](https://github.com/code-distortion/adapt/issues)[2 PRs](https://github.com/code-distortion/adapt/pulls)MITPHPPHP 7.0.\* | 7.1.\* | 7.2.\* | 7.3.\* | 7.4.\* | 8.0.\* | 8.1.\* | 8.2.\* | 8.3.\* | 8.4.\*CI failing

Since Aug 16Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/code-distortion/adapt)[ Packagist](https://packagist.org/packages/code-distortion/adapt)[ Docs](https://github.com/code-distortion/adapt)[ RSS](/packages/code-distortion-adapt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (55)Used By (0)

Adapt - A Database Preparation Tool
===================================

[](#adapt---a-database-preparation-tool)

[![Latest Version on Packagist](https://camo.githubusercontent.com/45eddf6177b12b62523e502d13e61f1d975932e311bb819ceda6919c730ca6c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64652d646973746f7274696f6e2f61646170742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/code-distortion/adapt)[![PHP Version](https://camo.githubusercontent.com/fc938f3a4835b52c2a9130b7f455bbf867cd4ea2b3d1566ef8464eca13274717/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e30253230746f253230382e342d626c75653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/fc938f3a4835b52c2a9130b7f455bbf867cd4ea2b3d1566ef8464eca13274717/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e30253230746f253230382e342d626c75653f7374796c653d666c61742d737175617265)[![Laravel](https://camo.githubusercontent.com/86d08113ae2889b23f9e5a828b197570b0b460a99435ad436327da472c9f8b3d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d352e312b253243253230362532432532303725324325323038253243253230392532432532303130253243253230313125323025323625323031322d626c75653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/86d08113ae2889b23f9e5a828b197570b0b460a99435ad436327da472c9f8b3d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d352e312b253243253230362532432532303725324325323038253243253230392532432532303130253243253230313125323025323625323031322d626c75653f7374796c653d666c61742d737175617265)[![GitHub Workflow Status](https://camo.githubusercontent.com/6148463e602c306ccd5531bc370fff4b183db263b1a56665321119e4df3e483e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f64652d646973746f7274696f6e2f61646170742f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/code-distortion/adapt/actions)[![Buy The World a Tree](https://camo.githubusercontent.com/dc3f77a9b22c3bc83c7b7d863bf138a7ca3418f1826b0b16d073d0aa87c16bc4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74726565776172652d2546302539462538432542332d6c69676874677265656e3f7374796c653d666c61742d737175617265)](https://plant.treeware.earth/code-distortion/adapt)[![Contributor Covenant](https://camo.githubusercontent.com/902d296a65b2997bada7e7717fd929d9177f3bd95414cbb5ea2ed843c680f314/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e7472696275746f72253230636f76656e616e742d76322e3125323061646f707465642d6666363962342e7376673f7374796c653d666c61742d737175617265)](.github/CODE_OF_CONDUCT.md)

**code-distortion/adapt** is a package for [Laravel](https://laravel.com/) that *builds databases for your tests*.

Features
--------

[](#features)

- Adapt is a [swap-in replacement](https://code-distortion.net/docs/adapt/usage/) for Laravel's `RefreshDatabase`, `DatabaseMigrations`, and `DatabaseTransactions` traits.
- To get the best speeds, your [databases are reused](https://code-distortion.net/docs/adapt/reusing-databases/) (when possible) each time you run your tests.
- A new (experimental MySQL) [journaling method](https://code-distortion.net/docs/adapt/reusing-databases/#journaling) for reusing databases. This is an alternative for when [transactions](https://code-distortion.net/docs/adapt/reusing-databases/#transactions) can't be used (like when browser testing).
- You don't need to create empty databases beforehand. They're [created automatically](https://code-distortion.net/docs/adapt/building-a-database/).
- There's no need to drop or rebuild databases yourself. They are [automatically rebuilt](https://code-distortion.net/docs/adapt/building-a-database/#rebuilding-your-database) when you change your migrations, seeders or factories.
- Lets you [import](https://code-distortion.net/docs/adapt/building-a-database/#imports) custom sql-dump files before running your [migrations](https://code-distortion.net/docs/adapt/building-a-database/#migrations).
- Your tests can use different [seeders](https://code-distortion.net/docs/adapt/building-a-database/#seeders) for different tests, without them needing to be re-run each time.
- You can include [Dusk browser tests](https://code-distortion.net/docs/adapt/browser-testing/) in your normal test run - there's no need to run `php artisan dusk` separately.
- You can [run your tests in parallel](https://code-distortion.net/docs/adapt/parallel-testing/), separate databases are created for each process.
- You can also run [Dusk browser tests](https://code-distortion.net/docs/adapt/browser-testing/) in parallel.
- If your project [has more than one database](https://code-distortion.net/docs/adapt/building-a-database/#building-extra-databases), you can build them as well. Each with their own migrations and seeders.
- If you have two or more Laravel codebases in your project, you can have one [build databases](https://code-distortion.net/docs/adapt/remote-databases/#building-databases-remotely) for the others.

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

[](#documentation)

The documentation for this package has a [its own dedicated page](https://code-distortion.net/packages/adapt). Please look there for details on how to install and configure Adapt.

Testing This Package
--------------------

[](#testing-this-package)

- Clone this package: `git clone https://github.com/code-distortion/adapt.git .`
- Run `composer install` to install dependencies
- Run the tests: `composer test`

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

### SemVer

[](#semver)

This library uses [SemVer 2.0.0](https://semver.org/) versioning. This means that changes to `X` indicate a breaking change: `0.0.X`, `0.X.y`, `X.y.z`. When this library changes to version 1.0.0, 2.0.0 and so forth, it doesn't indicate that it's necessarily a notable release, it simply indicates that the changes were breaking.

Treeware
--------

[](#treeware)

This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/code-distortion/adapt) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

### Code of Conduct

[](#code-of-conduct)

Please see [CODE\_OF\_CONDUCT](.github/CODE_OF_CONDUCT.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Tim Chandler](https://github.com/code-distortion)

License
-------

[](#license)

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

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance60

Regular maintenance activity

Popularity39

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity76

Established project with proven stability

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

Recently: every ~184 days

Total

51

Last Release

288d ago

PHP version history (6 changes)0.1.0PHP ^7.0

0.2.4PHP ^7.0 | ^8.0

0.6.5PHP 7.0.\* | 7.1.\* | 7.2.\* | 7.3.\* | 7.4.\* | 8.0.\* | 8.1.\*

0.12.3PHP 7.0.\* | 7.1.\* | 7.2.\* | 7.3.\* | 7.4.\* | 8.0.\* | 8.1.\* | 8.2.\*

0.12.12PHP 7.0.\* | 7.1.\* | 7.2.\* | 7.3.\* | 7.4.\* | 8.0.\* | 8.1.\* | 8.2.\* | 8.3.\*

0.12.13PHP 7.0.\* | 7.1.\* | 7.2.\* | 7.3.\* | 7.4.\* | 8.0.\* | 8.1.\* | 8.2.\* | 8.3.\* | 8.4.\*

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/56794290?v=4)[Tim](/maintainers/code-distortion)[@code-distortion](https://github.com/code-distortion)

---

Top Contributors

[![code-distortion](https://avatars.githubusercontent.com/u/56794290?v=4)](https://github.com/code-distortion "code-distortion (483 commits)")

---

Tags

testingphpunitpestlaraveldatabasetestsmigrationsparalleltransactionsintegration-testsseedersduskunit-testsDatabaseMigrationsRefreshDatabaseDatabaseTransactionsparatestfeature-testsbrowser-tests

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/code-distortion-adapt/health.svg)

```
[![Health](https://phpackages.com/badges/code-distortion-adapt/health.svg)](https://phpackages.com/packages/code-distortion-adapt)
```

###  Alternatives

[socialpoint/parallel-phpunit

Parallel Test Cases Runner for PHPUnit

1418.2k](/packages/socialpoint-parallel-phpunit)

PHPackages © 2026

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