Laravel Packages

Randomize Command Execution Time with the Chaotic Schedule Package for Laravel

Published
Randomize Command Execution Time with the Chaotic Schedule Package for Laravel image

The chaotic-schedule package for Laravel allows you to randomize scheduled command execution time and date intervals via Pseudorandom number generators (PRNGs):

Ever wanted to run your scheduled commands on random times of the day, or on certain days of the week? Or you may need to send some notifications not on fixed date times, but rather on random intervals hence it feels more human. Then this is the package you're looking for.

This Laravel packages enables you to run commands on random intervals and periods while respecting the boundaries set exclusively by you.

One use-case mentioned in the readme is sending user notifications or emails but sending them randomly to add a more personal human touch. Avoiding the sending of these messages at regular intervals at the same time would be more recognizably automated:

// Run a command daily on a random time between 08:15 and 11:42
$schedule->command('inspire')->daily()->atRandom('08:15','11:42');
 
// Run a command every Tuesday, Saturday and Sunday on a random time between 04:20 and 06:09
$schedule->command('your-command-signature:here')
->days([Schedule::TUESDAY, Schedule::SATURDAY, Schedule::SUNDAY])
->atRandom('04:20','06:09');

This package includes quite a few methods to define your random specifications based on several factors, such as:

  • dailyAtRandom()
  • hourlyAtRandom()
  • hourlyMultipleAtRandom()
  • randomDays()
  • And more...

You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Sponsored

serpapi logo
SerpApi

The Web Search API for Your LLM and AI Applications

Visit SerpApi

The latest

View all →
Image Dominant Color and HEIC Support in Laravel 13.24 image

Image Dominant Color and HEIC Support in Laravel 13.24

Read article
Official Laravel Zed Extension: LSP for PHP & Blade image

Official Laravel Zed Extension: LSP for PHP & Blade

Read article
Laravel Head: Manage Meta Tags, Open Graph, and JSON-LD image

Laravel Head: Manage Meta Tags, Open Graph, and JSON-LD

Read article
PhpStorm 2026.2 Released image

PhpStorm 2026.2 Released

Read article
Laravel Doctor: Diagnose Your App With One Artisan Command image

Laravel Doctor: Diagnose Your App With One Artisan Command

Read article
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article