PHP code example of monkeyscloud / monkeyslegion-schedule
1. Go to this page and download the library: Download monkeyscloud/monkeyslegion-schedule 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/ */
monkeyscloud / monkeyslegion-schedule example snippets
use MonkeysLegion\Schedule\Attributes\Scheduled;
#[Scheduled(expression: '* * * * * *')] // Second-precision!
class HeartbeatAction
{
public function __invoke()
{
// Runs every second
}
}
$schedule->command('report:generate --daily')->dailyAt('00:00');
$schedule->call(function() {
return "Pulse sent.";
})->everyFiveMinutes();