Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Eris Laravel Package

giorgiosironi/eris

Eris brings QuickCheck-style property-based testing to PHP and PHPUnit. Define properties and Eris generates hundreds of random inputs to break them, shrinking failures to minimal counterexamples. Install via Composer as a dev dependency; supports PHP 8.1+ and PHPUnit 10-13.

View on GitHub
Deep Wiki
Context7

Eris is a porting of Quickcheck and property-based testing tools to the PHP and PHPUnit ecosystem.

Frequently asked questions about Eris
What is Eris property-based testing for Laravel and PHPUnit?
Eris is a PHP port of QuickCheck-style property-based testing that integrates directly with PHPUnit through Eris\TestTrait and Eris\Facade. Instead of writing only example-based tests, you define properties and Eris generates many random inputs to try to break them. In a Laravel application it runs inside your existing PHPUnit suite, so there is no separate runner and no production runtime footprint.
How do I install Eris in a Laravel project?
Install it as a development dependency with composer require --dev giorgiosironi/eris. Your project must be on PHP 8.1 or newer and PHPUnit 10 through 13. After installation, add Eris\TestTrait to a PHPUnit test case and confirm that vendor/bin/phpunit still passes unchanged before adding property tests.
Does Eris support Laravel 10, 11, and 12 with PHPUnit 10 or newer?
Eris declares compatibility with PHP 8.1 and newer plus PHPUnit 10.x through 13.x, which covers typical Laravel 10, 11, and 12 projects already running PHPUnit 10 or 11. Anything below PHPUnit 10 blocks adoption outright, and PHP 8.1 is the minimum PHP version. Because Eris runs inside PHPUnit, it fits into the same phpunit.xml run as your existing Laravel tests.
How do I write a property-based test with Eris in PHPUnit?
Use Eris\TestTrait in a PHPUnit test case, call $this->forAll with one or more generators, and finish with then() containing your assertions. For example, forAll(Generators::choose(0, 1000))->then(function ($number) { ... }) generates values from that domain and stops at the first failure. Eris handles sampling and failure shrinking, while PHPUnit remains the source of truth for pass or fail.
Can Eris test Eloquent models and Laravel application code, or only pure functions?
Because Eris runs inside PHPUnit, Laravel test helpers such as database refresh, container bindings, and facades remain available inside then() callbacks. That means properties can target Eloquent models, value objects, and domain services as well as pure functions. The highest return on investment usually comes from domain-layer invariants such as round-trip conversions, idempotence, ordering, and money arithmetic.
How does Eris shrink failing inputs and show counterexamples?
Eris generates a sample of inputs from the required domain, verifies the property on each one, and stops at the first failure. Its shrinker then reduces the failing input toward a minimal counterexample, making the failure easier to understand and debug. The PHPUnit failure output shows the assertion message together with the reduced input that broke the property.
How do I make Eris tests reproducible in CI?
Property-based tests are stochastic unless the random seed is pinned, so CI reproducibility depends on capturing ERIS_SEED in the logs. When a property fails, rerun the suite with the same ERIS_SEED to reproduce the generated inputs and the shrunk counterexample. This is primarily a process concern: assign ownership of the seed convention and a triage runbook for counterexamples.
Does Eris add production dependencies or runtime overhead to a Laravel application?
No. Eris is a development-only testing library installed with composer require --dev, so it has zero production runtime footprint and no coupling to application code. It layers on top of PHPUnit rather than replacing it, so rollback is simply composer remove --dev. The only optional peer dependency risk called out is the regex() generator, which relies on a reverse-regex fork; teams that never call regex() avoid that risk.
What are alternatives to giorgiosironi/eris for property-based testing in PHP?
Eris is purpose-built as a QuickCheck port for the PHP and PHPUnit ecosystem, with generators, forAll/then quantifiers, shrinking, and listeners. If you only need example-based assertions, PHPUnit alone is sufficient because Eris is an additive capability rather than a replacement. When comparing alternatives, evaluate PHPUnit version support, shrinking quality, seed reproducibility, maintenance activity, and whether any optional generator brings fragile peer dependencies.
Is giorgiosironi/eris actively maintained and safe for long-term Laravel projects?
Releases and changelog activity are steady and recent, including a 1.0.0 stable semantic-versioning milestone and a 1.3.0 release adding PHP 8.5 support plus regex random-source and unbounded-quantifier controls. The project reads as maintainer-led with occasional contributors, and its 442 stars and zero declared dependents mean limited ecosystem pressure-testing compared with larger PHPUnit extensions. For additive development-only use it is a low-risk adoption, but teams should flag the single-maintainer signal and the optional reverse-regex fork dependency.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo