Schedule
class Schedule (View source)
Traits
Macroable |
Properties
static protected array | $macros | The registered string macros. | from Macroable |
protected Event[] | $events | All of the events on the schedule. | |
protected EventMutex | $eventMutex | The event mutex implementation. | |
protected SchedulingMutex | $schedulingMutex | The scheduling mutex implementation. | |
protected DateTimeZone|string | $timezone | The timezone the date should be evaluated on. | |
protected Dispatcher | $dispatcher | The job dispatcher implementation. |
Methods
static void | macro(string $name, object|callable $macro) Register a custom macro. | from Macroable |
static void | mixin(object $mixin, bool $replace = true) Mix another object into the class. | from Macroable |
static bool | hasMacro(string $name) Checks if macro is registered. | from Macroable |
static mixed | __callStatic(string $method, array $parameters) Dynamically handle calls to the class. | from Macroable |
mixed | __call(string $method, array $parameters) Dynamically handle calls to the class. | from Macroable |
void | __construct(DateTimeZone|string|null $timezone = null) Create a new schedule instance. | |
CallbackEvent | call(string|callable $callback, array $parameters = []) Add a new callback event to the schedule. | |
Event | command(string $command, array $parameters = []) Add a new Artisan command event to the schedule. | |
CallbackEvent | job(object|string $job, string|null $queue = null, string|null $connection = null) Add a new job callback event to the schedule. | |
void | dispatchToQueue(object $job, string|null $queue, string|null $connection) Dispatch the given job to the queue. | |
void | dispatchNow(object $job) Dispatch the given job right now. | |
Event | exec(string $command, array $parameters = []) Add a new command event to the schedule. | |
string | compileParameters(array $parameters) Compile parameters for a command. | |
string | compileArrayInput(string|int $key, array $value) Compile array input for a command. | |
bool | serverShouldRun(Event $event, DateTimeInterface $time) Determine if the server is allowed to run this event. | |
Collection | dueEvents(Application $app) Get all of the events on the schedule that are due. | |
Event[] | events() Get all of the events on the schedule. | |
$this | useCache(string $store) Specify the cache store that should be used to store mutexes. | |
Dispatcher | getDispatcher() Get the job dispatcher, if available. |
Details
static void macro(string $name, object|callable $macro)
Register a custom macro.
static void mixin(object $mixin, bool $replace = true)
Mix another object into the class.
static bool hasMacro(string $name)
Checks if macro is registered.
static mixed __callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
mixed __call(string $method, array $parameters)
Dynamically handle calls to the class.
void __construct(DateTimeZone|string|null $timezone = null)
Create a new schedule instance.
CallbackEvent call(string|callable $callback, array $parameters = [])
Add a new callback event to the schedule.
Event command(string $command, array $parameters = [])
Add a new Artisan command event to the schedule.
CallbackEvent job(object|string $job, string|null $queue = null, string|null $connection = null)
Add a new job callback event to the schedule.
protected void dispatchToQueue(object $job, string|null $queue, string|null $connection)
Dispatch the given job to the queue.
protected void dispatchNow(object $job)
Dispatch the given job right now.
Event exec(string $command, array $parameters = [])
Add a new command event to the schedule.
protected string compileParameters(array $parameters)
Compile parameters for a command.
string compileArrayInput(string|int $key, array $value)
Compile array input for a command.
bool serverShouldRun(Event $event, DateTimeInterface $time)
Determine if the server is allowed to run this event.
Collection dueEvents(Application $app)
Get all of the events on the schedule that are due.
Event[] events()
Get all of the events on the schedule.
$this useCache(string $store)
Specify the cache store that should be used to store mutexes.
protected Dispatcher getDispatcher()
Get the job dispatcher, if available.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/7.x/Illuminate/Console/Scheduling/Schedule.html