1. Go to this page and download the library: Download laraveljutsu/bazooka library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
return [
'enabled' => env('BAZOOKA_ENABLED', true), // Enable or disable Bazooka globally
'probability' => 0.2, // Probability of chaos being injected or triggered (0 to 1)
'strategies' => [
'latency' => [
'min_delay' => 100, // Minimum delay in milliseconds
'max_delay' => 500, // Maximum delay in milliseconds
],
'exception' => [
'exceptions' => [
\RuntimeException::class => 'Something went wrong!', // Exception class and message
],
],
],
];
namespace App\Http\Controllers;
class TestController
{
public function index()
{
return 'Hello World';
}
}
namespace App\Http\Controllers;
class TestController
{
public function index()
{
\LaravelJutsu\Bazooka\Facades\Bazooka::chaos(); // Chaos point injected here
return 'Hello World';
}
}