PHP code example of kozo / quartz

1. Go to this page and download the library: Download kozo/quartz 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/ */

    

kozo / quartz example snippets


php artisan quartz:create

// sample


namespace App\Quartz;

use Watchmaker\Watchmaker;

class QuartzCron {

    public function handle(Watchmaker $watchmaker): Watchmaker
    {
        $task1 = $watchmaker->task('php hoge/fuga.php');
        $task1 = $task1
            ->month(1)
            ->day(5);
        $watchmaker->add($task1);

        $task2 = $watchmaker->task('php hoge/hoge.php');
        $task2 = $task2
            ->month(2)
            ->day(6);
        $watchmaker->add($task2);

        return $watchmaker;
    }
}

php artisan quartz:install