Download the PHP package laraveljutsu/bazooka without Composer
On this page you can find all versions of the php package laraveljutsu/bazooka. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laraveljutsu/bazooka
More information about laraveljutsu/bazooka
Files in laraveljutsu/bazooka
Package bazooka
Short Description Bazooka is a Laravel package that allows developers to simulate controlled failures (like API timeouts) inside their application for resilience testing.
License MIT
Informations about the package bazooka
Introduction
Inject chaos into your Laravel application with ease!
Laravel Bazooka is a powerful Laravel package that allows you to inject controlled chaos into your application. Whether you're testing resilience, simulating failures, or just having fun, Bazooka provides a simple and configurable way to disrupt your application's behavior.
Features
- Inject Chaos Points: Add
Bazooka::chaos()
calls to your controller methods with a configurable probability. - Disruption Strategies: Choose from built-in strategies like latency delays or exception throwing.
- Command-Line Tools:
- Inject chaos points into controllers.
- List all chaos points in your application.
- Remove chaos points from your codebase.
- Dry Run Mode: Safely test the removal of chaos points without modifying files.
- Configurable Probability: Control the likelihood of chaos being injected or triggered.
Installation
You can install the package via Composer:
Laravel will automatically register the service provider.
If needed, add to config/app.php providers array:
Configuration
After publishing the configuration file, you can customize the behavior of Bazooka by editing config/bazooka.php
:
To publish the configuration file, run the following command:
Usage
Inject Chaos Points
Inject chaos points into your controller methods:
You can target specific controllers:
List Chaos Points
List all chaos points in your application:
Example output:
Remove Chaos Points
Remove all chaos points from your codebase:
Use the --dry-run
option to preview changes without modifying files:
Disruption Strategies
Bazooka comes with built-in disruption strategies. You can configure them in config/bazooka.php
.
Latency Disruption
Add a delay to your application.
Exception Disruption
Throw a prepared exception.
Example
Controller Before Injection
Controller After Injection
Testing
Run the test suite to ensure everything works as expected:
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This package is open-source software licensed under the MIT License.
Credits
- Developed by ludo 🐆
- Inspired by the need for chaos engineering in Laravel applications.
Enjoy injecting chaos into your Laravel applications with Laravel Bazooka! 🎉