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.

Parameters

string $name
object|callable $macro

Return Value

void

static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

static bool hasMacro(string $name)

Checks if macro is registered.

Parameters

string $name

Return Value

bool

static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

void __construct(DateTimeZone|string|null $timezone = null)

Create a new schedule instance.

Parameters

DateTimeZone|string|null $timezone

Return Value

void

CallbackEvent call(string|callable $callback, array $parameters = [])

Add a new callback event to the schedule.

Parameters

string|callable $callback
array $parameters

Return Value

CallbackEvent

Event command(string $command, array $parameters = [])

Add a new Artisan command event to the schedule.

Parameters

string $command
array $parameters

Return Value

Event

CallbackEvent job(object|string $job, string|null $queue = null, string|null $connection = null)

Add a new job callback event to the schedule.

Parameters

object|string $job
string|null $queue
string|null $connection

Return Value

CallbackEvent

protected void dispatchToQueue(object $job, string|null $queue, string|null $connection)

Dispatch the given job to the queue.

Parameters

object $job
string|null $queue
string|null $connection

Return Value

void

protected void dispatchNow(object $job)

Dispatch the given job right now.

Parameters

object $job

Return Value

void

Event exec(string $command, array $parameters = [])

Add a new command event to the schedule.

Parameters

string $command
array $parameters

Return Value

Event

protected string compileParameters(array $parameters)

Compile parameters for a command.

Parameters

array $parameters

Return Value

string

string compileArrayInput(string|int $key, array $value)

Compile array input for a command.

Parameters

string|int $key
array $value

Return Value

string

bool serverShouldRun(Event $event, DateTimeInterface $time)

Determine if the server is allowed to run this event.

Parameters

Event $event
DateTimeInterface $time

Return Value

bool

Collection dueEvents(Application $app)

Get all of the events on the schedule that are due.

Parameters

Application $app

Return Value

Collection

Event[] events()

Get all of the events on the schedule.

Return Value

Event[]

$this useCache(string $store)

Specify the cache store that should be used to store mutexes.

Parameters

string $store

Return Value

$this

protected Dispatcher getDispatcher()

Get the job dispatcher, if available.

Return Value

Dispatcher

© 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