PHP code example of jeremyrwross / frequency-scheduler
1. Go to this page and download the library: Download jeremyrwross/frequency-scheduler 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/ */
jeremyrwross / frequency-scheduler example snippets
// About six runs per hour during peak hours.
$schedule->command('social:post')
->everyFiveMinutes()
->frequencyByPeriod('09:00', '16:59', 50)
->timezone('America/Halifax')
->withoutOverlapping();
// About 1.2 runs per hour outside peak hours, including overnight.
$schedule->command('social:post')
->everyFiveMinutes()
->frequencyByPeriod('17:00', '08:59', 10)
->timezone('America/Halifax')
->withoutOverlapping();