lara-zeus/chaos
Part of the Lara Zeus suite, Chaos is a Laravel package that speeds up building dynamic, data-driven applications with reusable utilities and sensible conventions that cut boilerplate and keep your codebase clean and maintainable.
Architecture fit. The sources describe two different products, and that is the first thing to resolve. The package description positions lara-zeus/chaos as a low-ceremony Filament/Lara Zeus prototyping companion — wiring Zeus components together, keeping experiments out of application code. Every downstream assessment instead characterises it as a fault-injection / chaos engineering tool for Laravel: config-driven rules and triggers, probabilistic failure injection, environment-aware safeguards. Those have materially different integration costs and different owners (product engineering vs. platform/reliability). Until someone reads the tagged source and the published config file, architecture fit is unassessed, not "good." If it is the fault-injection tool, it fits a conventional Laravel app cleanly: Composer install with auto-discovery, no manual provider registration, rules expressed in a published config, injection called from application code at boundaries (HTTP clients, queue dispatch, cache, filesystem). That is an additive, dev-only, single-line-per-call-site shape that fits a standard Laravel architecture without restructuring anything.
Integration feasibility. Low effort, high reversibility. composer require, vendor:publish the Chaos config, put an env flag in .env.example set to false. Budget a 1–3 day engineer spike: install, read the config and the tests/ directory (the Pest suite added in 3.0.7 is the most reliable usage documentation), then wire exactly one boundary failure — a single outbound Http:: call or one queued job that talks to a third party — and walk the error path end to end: does the retry retry, does the fallback render, does the job land in failed_jobs, does the user see a sane message. That loop validates the abstraction and audits error handling simultaneously. Success criteria should be written before the spike starts.
Technical risk. Ranked:
.env can enable it in production, converts a quality initiative into an outage vector. Mitigation is a boot-time assertion that throws when chaos is enabled under app()->isProduction(), plus keeping the key out of the production secret store entirely — not merely absent by convention.Key questions to answer before commitment.
^3.0, and does that match our current floor?App::environment() check plus a random integer acceptable?Stack fit. Standard Laravel + Composer, installed to require-dev or behind a feature flag. If it is the fault-injection tool, place injection only at boundaries the application does not control — HTTP clients, queue dispatch, cache, filesystem writes, occasionally DB. Never inside domain logic: failures there are hard to attribute and impossible to reason about. Rules live in config/chaos.php under version control so behaviour flips without a deploy; call sites stay a single greppable line.
Migration path. There is no migration — this is purely additive and fully removable. That is its main strategic virtue: we can run the experiment, learn whether our error paths hold, and rip it out without a refactor. Protect that property with a thin seam: wrap injection in one internal helper (ChaosGuard-style) so no LaraZeus\Chaos\* reference is scattered through the app. One indirection layer means a version bump, a swap to a home-grown equivalent, or removal is a single-file change. With zero upstream dependents, this is the cheapest insurance available.
Compatibility. Pin ^3.0. Upgrade all Lara Zeus packages in one PR. Read 3.0.7 correctly: the major version bumps (actions/checkout 4→7, ramsey/composer-install 3→4, stefanzweifel/git-auto-commit-action 5→7, laravel-pint-action 2.3→2.6) are CI tooling, not runtime — do not treat them as breaking, and do not assume future releases are equally inert. Diff tagged source on each bump rather than trusting changelogs. Note the config-cache interaction: config:cache snapshots the file, so post-hoc env flips silently do nothing.
Sequencing.
tests/. Resolve the product-identity ambiguity. Confirm Packagist truth against the future-dated release.chaos log/metric marker mandated for every injected failure. Decide this before adoption, not after.payment-timeout, checkout-degraded) rather than a global dice roll. Named scenarios double as shared vocabulary in incident retros and prevent two developers blaming each other's branches.Maintenance. Single maintainer, MIT, 3 stars, 0 dependents, one release channel. Maintenance burden on us is genuinely small — a pinned dev dependency and a config file — but the continuity burden is ours alone. Plan on "fork it" being an acceptable answer before this touches anything that matters. A contract test over the public surface we actually use keeps minor bumps honest.
Support. GitHub Issues only; no SLA, no named commitment, no commercial backstop. Route questions to the source and the Pest suite first — they will answer faster than the issue tracker. Do not let this sit on a critical path where a blocking bug becomes a schedule risk.
Scaling. Two constraints. First, chaos multiplies existing budgets: a job with three retries and a 60-second timeout turns a 5-minute queue drain into 20 minutes, which on shared staging reads as a real outage. Audit retry counts and timeouts before raising probability, and start in single-digit percentages. Second, scope discipline: a global 20% failure rate across a shared environment destroys a team's afternoon. Scope by route, tenant, user, or named scenario. Pair every injected failure with an attributable log line or metric carrying a chaos marker — otherwise the first person to see it assumes it is real and the exercise becomes a support ticket.
Failure modes to design against.
| Failure mode | Impact | Control |
|---|---|---|
Chaos enabled in production via copied .env |
Real outage during "testing" | Boot-time assertion + key absent from prod secrets |
config:cache masks a toggle |
Team concludes tool is broken | config:clear after toggles, or chaos off in cached envs by design |
| Probabilistic rules in CI | Flaky tests, lost trust | Fixed seed / forced-failure mode for all automated runs |
| Unmarked injected errors | Misdiagnosis, wasted on-call time | Mandatory chaos marker in every emitted failure |
| Global unscoped rules | Developer blame cycles | Named scenarios, opt-in per developer |
| Package abandonment | Blocked upgrades | Thin seam; fork-ready posture |
| Wrong-layer adoption | Spend on diagnosis we don't need | Confirm gap is application-level before committing |
Ramp-up. Low ceiling, shallow curve — one config file, one call-site convention, one seam class. The real ramp-up cost is cultural: getting a team to treat failure injection as a routine habit rather than a one-off spike, and getting reviewers to treat config/chaos.php changes like code. Expect the initial spike to produce more value from the error-handling audit it forces than from the tool itself. That is a fine outcome — but if the reliability gaps are already understood and the constraint is remediation capacity, this buys diagnosis we don't need, and the honest call is to skip it and go fix the gaps.
How can I help you explore Laravel packages today?