Schedule
class Schedule (View source)
Traits
Constants
SUNDAY |
|
MONDAY |
|
TUESDAY |
|
WEDNESDAY |
|
THURSDAY |
|
FRIDAY |
|
SATURDAY |
|
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
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Add a new callback event to the schedule.
Add a new Artisan command event to the schedule.
Add a new job callback event to the schedule.
Dispatch the given job to the queue.
Dispatch the given unique job to the queue.
Dispatch the given job right now.
Compile parameters for a command.
Compile array input for a command.
Determine if the server is allowed to run this event.
Specify the cache store that should be used to store mutexes.
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 void
flushMacros()
Flush the existing macros.
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
dispatchUniqueJobToQueue(object $job, string|null $queue, string|null $connection)
Dispatch the given unique 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.