PHP code example of switon / schedule
1. Go to this page and download the library: Download switon/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/ */
switon / schedule example snippets
use Switon\Core\Contract\RunnerInterface;
use Switon\Schedule\Attribute\Scheduled;
#[Scheduled('0 0 * *')]
final class PurgeStaleSessionsTask implements RunnerInterface
{
public function run(mixed $payload): mixed
{
return null;
}
}