PHPackages                             laravel-chaos/testing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. laravel-chaos/testing

ActiveLibrary[Testing &amp; Quality](/categories/testing)

laravel-chaos/testing
=====================

A Laravel package for chaos engineering: deletes random files at random times.

v1.2(5mo ago)06MITPHPPHP ^8.0CI passing

Since Nov 20Pushed 1mo agoCompare

[ Source](https://github.com/TharinduWijayarathna/laravel-chaos)[ Packagist](https://packagist.org/packages/laravel-chaos/testing)[ Docs](https://github.com/laravel-chaos/testing)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/laravel-chaos-testing/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (10)Used By (0)

Laravel Chaos Testing
=====================

[](#laravel-chaos-testing)

[![Latest Version on Packagist](https://camo.githubusercontent.com/861a95fa3c4ab57848dfc17feb519548ad8827196afc0188ac77c179552f004e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6368616f732f74657374696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-chaos/testing)[![GitHub Tests Action Status](https://camo.githubusercontent.com/ceeed4f1dfe3c6ba86c1ff2b0316749ec601075a5f0fb2310d295f26bcf61730/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c61726176656c2d6368616f732f74657374696e672f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/laravel-chaos/testing/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/cb451bebdce81b83cdb53ca9bb0e2eabca01512f453ea74b6ba79039efec8f03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6368616f732f74657374696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-chaos/testing)

A Laravel package for chaos engineering that deletes random files at random times. Use this to test your application's resilience against data loss or file system corruption.

Warning

**This package deletes files.** Do not use this in production unless you are absolutely sure what you are doing and have backups.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require laravel-chaos/testing
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-chaos-testing-config"
```

This is the contents of the published config file:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Chaos Enabled
    |--------------------------------------------------------------------------
    |
    | This option controls whether the chaos command is enabled.
    | It is recommended to keep this disabled in production unless you
    | really know what you are doing.
    |
    */
    'enabled' => env('CHAOS_ENABLED', false),

    /*
    |--------------------------------------------------------------------------
    | Chaos Interval
    |--------------------------------------------------------------------------
    |
    | How often chaos should occur. Supported values:
    | - 'minute' (every minute)
    | - 'hour' (every hour)
    | - 'day' (every day)
    | - 'week' (every week)
    | - 'month' (every month)
    |
    */
    'interval' => env('CHAOS_INTERVAL', 'week'),

    /*
    |--------------------------------------------------------------------------
    | Target Paths
    |--------------------------------------------------------------------------
    |
    | The paths where the chaos command will look for files to delete.
    |
    */
    'paths' => [
        storage_path('logs'),
    ],

    /*
    |--------------------------------------------------------------------------
    | Target Extensions
    |--------------------------------------------------------------------------
    |
    | If specified, only files with these extensions will be deleted.
    | Leave empty to target all files.
    |
    */
    'extensions' => [],

    /*
    |--------------------------------------------------------------------------
    | Filesystem Disk
    |--------------------------------------------------------------------------
    |
    | The filesystem disk to use.
    |
    */
    'disk' => 'local',
];
```

Usage
-----

[](#usage)

Once installed and enabled, the package registers a scheduled command `chaos:process` that runs hourly.

The command checks if it's time to "unleash chaos" based on a random schedule within your configured interval (default: once per week). If it is time, it will pick a random file from your configured `paths` and delete it.

### Configuration

[](#configuration)

1. Set the interval in your `.env`:

    ```
    CHAOS_ENABLED=true
    CHAOS_INTERVAL=week  # minute, hour, day, week, or month
    ```
2. Or publish and edit the config file:

    ```
    php artisan vendor:publish --tag="laravel-chaos-testing-config"
    ```

You can also run the command manually:

```
php artisan chaos:process
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Tharindu Wijayarathna](https://github.com/TharinduWijayarathna)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance81

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

8

Last Release

179d ago

Major Versions

v0.5 → v1.02025-11-20

v0.2.0 → v1.22025-11-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2d26e7f2ae7faffa153b86b7adac4068b066b16c544a92e5e3429c39ce92ef1?d=identicon)[tharindu](/maintainers/tharindu)

---

Top Contributors

[![TharinduWijayarathna](https://avatars.githubusercontent.com/u/81649942?v=4)](https://github.com/TharinduWijayarathna "TharinduWijayarathna (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

testinglaravelchaos

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/laravel-chaos-testing/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-chaos-testing/health.svg)](https://phpackages.com/packages/laravel-chaos-testing)
```

###  Alternatives

[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[sti3bas/laravel-scout-array-driver

Array driver for Laravel Scout

971.5M3](/packages/sti3bas-laravel-scout-array-driver)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-visit

Quickly visit any route of your Laravel app

15614.6k](/packages/spatie-laravel-visit)[marvinrabe/laravel-graphql-test

Provides you with a simple GraphQL testing trait.

58329.7k](/packages/marvinrabe-laravel-graphql-test)[michiruf/laravel-http-automock

Automatically mock http requests when testing

161.0k](/packages/michiruf-laravel-http-automock)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
