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
Random Disaster Bundle

Random Disaster Bundle Laravel Package

matthiasnoback/random-disaster-bundle

A Symfony bundle that randomly injects exceptions into your app so you can test how it behaves when things go wrong. Set a failure rate and RandomDisasterBundle throws unexpected errors at random points during requests—ideal for verifying error pages, logging, and monitoring before real incidents.

View on GitHub
Deep Wiki
Context7

ProjectBundle a.k.a. RandomDisasterBundle

Frequently asked questions about Random Disaster Bundle
Can I use matthiasnoback/random-disaster-bundle in a Laravel application?
No. Despite being indexed as a general PHP package, RandomDisasterBundle is a Symfony bundle that depends on bundle registration, DI container compiler passes, and kernel.request/kernel.response event subscribers — none of which exist in a Laravel application. There is no service provider, middleware, facade, or config shim that would let it boot inside Laravel. The transferable asset is the concept of probability-gated fault injection during a request, not the code itself.
Does RandomDisasterBundle support Laravel 10 or 11 and PHP 8.2+?
No. The package carries PHP 7.x-era constraints and Symfony 2.x/3.x assumptions, so Composer will not resolve it cleanly against modern Laravel on PHP 8.2+. Even in require-dev it adds a Symfony dependency graph that creates resolver noise in a Laravel project. There is no Laravel version of the bundle and no Laravel-facing release planned.
What does RandomDisasterBundle actually do?
It randomly throws exceptions from targeted services or controllers so you can verify that error pages, loggers, alerting, and monitoring pipelines actually work. Failure probability and the affected classes are configurable through pure YAML, with no application code changes required. When disabled it is completely inert, which is why it framed itself as safe for production environments.
How do you configure failure probability and affected classes in RandomDisasterBundle?
Configuration is done entirely in Symfony YAML: you set a failure probability and list the classes or services that should be eligible for random failure, plus an environment toggle. That config tree is a Symfony extension, so there is no equivalent config/chaos.php or Laravel config publishing. If you want the same knobs in Laravel you have to define them yourself.
Is RandomDisasterBundle safe to enable in production?
Risky. The documented guardrails are only a probability setting and an environment toggle; there is no evidence of a scoped endpoint allowlist, a hard production block, or a kill switch enabled by default. Since the package's whole purpose is to deliberately fail requests, the primary failure mode is a misconfiguration reaching production. If you build your own version, gate it on CHAOS_ENABLED plus a non-production environment check and add an explicit kill switch.
How do I inject random exceptions into Laravel requests to test error handling?
Write a small middleware — roughly 50 to 100 lines — that, with a configured probability, throws a RuntimeException, adds bounded latency via usleep, or returns a weighted 4xx/5xx response. Register it from a service provider only when CHAOS_ENABLED is true and the app environment is not production, and support a route allowlist so the blast radius stays small. That is cheaper to write and far cheaper to own than adapting a Symfony bundle.
How do I test that my Laravel error pages, logging, and monitoring actually work?
Use Laravel's HTTP test helpers with a seeded or forced-injection mode so the failure is deterministic, then assert the 500 error page renders, the expected log entry is written, and your alerting hook fires. Pair that with a manual staging run at a low probability to exercise on-call response end to end. Define success criteria up front, for example: the checkout error page renders, the alert fires, and on-call acknowledges.
How much work is it to port a Symfony bundle to Laravel?
More than rewriting it. A thin adapter would have to bridge Symfony's HTTP kernel and event dispatcher onto Laravel's middleware pipeline and container semantics, and it would still inherit the upstream lifecycle risk. Reimplementation sidesteps the version constraint web entirely and removes the Symfony dependency graph from your composer.json. Realistically this is a one-day internal spike, not a roadmap item.
What are the alternatives to RandomDisasterBundle for Laravel?
There is no direct Laravel port, so the practical alternatives are a short custom middleware spike or a dedicated chaos engineering platform if resilience is a broad, funded program. For a single staging route at low probability, the middleware is the right spend; for organization-wide fault injection, a real chaos tool is. Either way, keep the Symfony bundle out of composer.json, including require-dev.
Who maintains RandomDisasterBundle and is it still worth depending on?
It has a single maintainer, around 114 stars, and zero dependents, and its name and framing read as a teaching or demo artifact. There is no meaningful security posture or CVE history to lean on, and it assumes PHP 7.x-era Symfony. Putting that into a composer.json you have to support for 18 months is a bad trade — approve the pattern, not the package.
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