iicn/schedule

A short description of what your package does

1.0.1 2024-08-05 08:48 UTC

This package is auto-updated.

Last update: 2025-03-05 10:01:30 UTC


README

Welcome to the Schedule package!

Getting Started

add Command to Kernel Schedule:

add command to app/Console/Kernel.php in method shedule:

$schedule->command('scheduler:run-command')->everyMinute();

use:

create class for schedule and extend from: \IICN\Schedule\Models\Schedule\ScheduleBuilder

example:

<?php

use IICN\Schedule\ScheduleBuilder;

class TestRunSchedule extends ScheduleBuilder
{

    public function __construct($arg1, $arg2) {
    
    }
    public function run()
    {
        // TODO: Implement run() method.
    }
}

run code based on UTC:

use IICN\Schedule\TaskScheduler;

TaskScheduler::do(TestRunSchedule::class, [$arg1, $arg2])->at('2024-02-02 20:28', "UTC");

run code in multi timezone:

use IICN\Schedule\TaskScheduler;

TaskScheduler::do(TestRunSchedule::class, [$arg1, $arg2])->at('2024-02-02 20:28', ["UTC", "Tehran"]);

run code in all timezones:

use IICN\Schedule\TaskScheduler;

TaskScheduler::do(TestRunSchedule::class, [$arg1, $arg2])->at('2024-02-02 20:28');