class PendingEventAttributes mixin Schedule (View source)

Traits

Constants

DEFERRED_EVENT_METHODS

Event lifecycle and output methods that should be deferred and replayed on each event in the group.

Properties

string $expression

The cron expression representing the event's frequency.

from  ManagesAttributes
int|null $repeatSeconds

How often to repeat the event during a minute.

from  ManagesAttributes
DateTimeZone|string $timezone

The timezone the date should be evaluated on.

from  ManagesAttributes
string|null $user

The user the command should run as.

from  ManagesAttributes
array $environments

The list of environments the command should run under.

from  ManagesAttributes
bool $evenInMaintenanceMode

Indicates if the command should run in maintenance mode.

from  ManagesAttributes
bool $evenWhenPaused

Indicates if the command should run even when the scheduler is paused.

from  ManagesAttributes
bool $withoutOverlapping

Indicates if the command should not overlap itself.

from  ManagesAttributes
bool $releaseOnTerminationSignals

Indicates if the mutex should be released when the process receives a termination signal.

from  ManagesAttributes
bool $onOneServer

Indicates if the command should only be allowed to run on one server for each cron expression.

from  ManagesAttributes
int $expiresAt

The number of minutes the mutex should be valid.

from  ManagesAttributes
bool $runInBackground

Indicates if the command should run in the background.

from  ManagesAttributes
protected array $filters

The array of filter callbacks.

from  ManagesAttributes
protected array $rejects

The array of reject callbacks.

from  ManagesAttributes
string|null $description

The human-readable description of the event.

from  ManagesAttributes
array<array-key, mixed> $attributes

The arbitrary attributes stored with the event.

from  ManagesAttributes
protected array<int, array{string, array}> $macros

The recorded macro and deferred method calls to replay on each event.

Methods

$this
user(string $user)

Set which user the command should run as.

$this
environments(mixed $environments)

Limit the environments the command should run in.

$this
evenInMaintenanceMode()

State that the command should run even in maintenance mode.

$this
evenWhenPaused()

State that the command should run even when the scheduler is paused.

$this
withoutOverlapping(int $expiresAt = 1440, bool $releaseOnTerminationSignals = true)

Do not allow the event to overlap each other.

$this
onOneServer()

Allow the event to only run on one server for each cron expression.

$this
runInBackground()

State that the command should run in the background.

$this
when(Closure|bool $callback)

Register a callback to further filter the schedule.

$this
skip(Closure|bool $callback)

Register a callback to further filter the schedule.

$this
name(string $description)

Set the human-friendly description of the event.

$this
description(string $description)

Set the human-friendly description of the event.

$this
withAttributes(array<array-key, mixed> $attributes)

Set arbitrary attributes to store with the event.

$this
cron(string $expression)

The Cron expression representing the event's frequency.

$this
between(string $startTime, string $endTime)

Schedule the event to run between start and end time.

$this
unlessBetween(string $startTime, string $endTime)

Schedule the event to not run between start and end time.

$this
everySecond()

Schedule the event to run every second.

$this
everyTwoSeconds()

Schedule the event to run every two seconds.

$this
everyFiveSeconds()

Schedule the event to run every five seconds.

$this
everyTenSeconds()

Schedule the event to run every ten seconds.

$this
everyFifteenSeconds()

Schedule the event to run every fifteen seconds.

$this
everyTwentySeconds()

Schedule the event to run every twenty seconds.

$this
everyThirtySeconds()

Schedule the event to run every thirty seconds.

$this
repeatEvery(int<1, 59> $seconds)

Schedule the event to run multiple times per minute.

$this
everyMinute()

Schedule the event to run every minute.

$this
everyTwoMinutes()

Schedule the event to run every two minutes.

$this
everyThreeMinutes()

Schedule the event to run every three minutes.

$this
everyFourMinutes()

Schedule the event to run every four minutes.

$this
everyFiveMinutes()

Schedule the event to run every five minutes.

$this
everyTenMinutes()

Schedule the event to run every ten minutes.

$this
everyFifteenMinutes()

Schedule the event to run every fifteen minutes.

$this
everyThirtyMinutes()

Schedule the event to run every thirty minutes.

$this
hourly()

Schedule the event to run hourly.

$this
hourlyAt(array|string|int<0, 59>|array<int<0, 59>> $offset)

Schedule the event to run hourly at a given offset in the hour.

$this
everyOddHour(array|string|int $offset = 0)

Schedule the event to run every odd hour.

$this
everyTwoHours(array|string|int $offset = 0)

Schedule the event to run every two hours.

$this
everyThreeHours(array|string|int $offset = 0)

Schedule the event to run every three hours.

$this
everyFourHours(array|string|int $offset = 0)

Schedule the event to run every four hours.

$this
everySixHours(array|string|int $offset = 0)

Schedule the event to run every six hours.

$this
daily()

Schedule the event to run daily.

$this
at(string $time)

Schedule the command at a given time.

$this
dailyAt(string $time)

Schedule the event to run daily at a given time (10:00, 19:30, etc).

$this
twiceDaily(int<0, 23> $first = 1, int<0, 23> $second = 13)

Schedule the event to run twice daily.

$this
twiceDailyAt(int<0, 23> $first = 1, int<0, 23> $second = 13, int<0, 59> $offset = 0)

Schedule the event to run twice daily at a given offset.

$this
hourBasedSchedule(array|string|int<0, 59> $minutes, array|string|int<0, 23> $hours)

Schedule the event to run at the given minutes and hours.

$this
weekdays()

Schedule the event to run only on weekdays.

$this
weekends()

Schedule the event to run only on weekends.

$this
mondays()

Schedule the event to run only on Mondays.

$this
tuesdays()

Schedule the event to run only on Tuesdays.

$this
wednesdays()

Schedule the event to run only on Wednesdays.

$this
thursdays()

Schedule the event to run only on Thursdays.

$this
fridays()

Schedule the event to run only on Fridays.

$this
saturdays()

Schedule the event to run only on Saturdays.

$this
sundays()

Schedule the event to run only on Sundays.

$this
weekly()

Schedule the event to run weekly.

$this
weeklyOn(mixed $dayOfWeek, string $time = '0:0')

Schedule the event to run weekly on a given day and time.

$this
monthly()

Schedule the event to run monthly.

$this
monthlyOn(int<1, 31> $dayOfMonth = 1, string $time = '0:0')

Schedule the event to run monthly on a given day and time.

$this
twiceMonthly(int<1, 31> $first = 1, int<1, 31> $second = 16, string $time = '0:0')

Schedule the event to run twice monthly at a given time.

$this
lastDayOfMonth(string $time = '0:0')

Schedule the event to run on the last day of the month.

$this
daysOfMonth(array<int<1, 31>>|int<1, 31> ...$days)

Schedule the event to run on specific days of the month.

$this
quarterly()

Schedule the event to run quarterly.

$this
quarterlyOn(int $dayOfQuarter = 1, string $time = '0:0')

Schedule the event to run quarterly on a given day and time.

$this
yearly()

Schedule the event to run yearly.

$this
yearlyOn(int $month = 1, int<1, 31>|string $dayOfMonth = 1, string $time = '0:0')

Schedule the event to run yearly on a given month, day, and time.

$this
days(mixed $days)

Set the days of the week the command should run on.

$this
timezone(UnitEnum|DateTimeZone|string $timezone)

Set the timezone the date should be evaluated on.

$this
spliceIntoPosition(int $position, string|int $value)

Splice the given value into the given position of the expression.

__construct(Schedule $schedule)

Create a new pending event attributes instance.

void
mergeAttributes(Event $event)

Merge the current attributes into the given event.

mixed
__call(string $method, array $parameters)

Proxy missing methods onto the underlying schedule.

Details

$this user(string $user)

Set which user the command should run as.

Parameters

string $user

Return Value

$this

$this environments(mixed $environments)

Limit the environments the command should run in.

Parameters

mixed $environments

Return Value

$this

$this evenInMaintenanceMode()

State that the command should run even in maintenance mode.

Return Value

$this

$this evenWhenPaused()

State that the command should run even when the scheduler is paused.

Return Value

$this

$this withoutOverlapping(int $expiresAt = 1440, bool $releaseOnTerminationSignals = true)

Do not allow the event to overlap each other.

The expiration time of the underlying cache lock may be specified in minutes.

Parameters

int $expiresAt
bool $releaseOnTerminationSignals

Return Value

$this

$this onOneServer()

Allow the event to only run on one server for each cron expression.

Return Value

$this

$this runInBackground()

State that the command should run in the background.

Return Value

$this

$this when(Closure|bool $callback)

Register a callback to further filter the schedule.

Parameters

Closure|bool $callback

Return Value

$this

$this skip(Closure|bool $callback)

Register a callback to further filter the schedule.

Parameters

Closure|bool $callback

Return Value

$this

$this name(string $description)

Set the human-friendly description of the event.

Parameters

string $description

Return Value

$this

$this description(string $description)

Set the human-friendly description of the event.

Parameters

string $description

Return Value

$this

$this withAttributes(array<array-key, mixed> $attributes)

Set arbitrary attributes to store with the event.

Parameters

array<array-key, mixed> $attributes

Return Value

$this

$this cron(string $expression)

The Cron expression representing the event's frequency.

Parameters

string $expression

Return Value

$this

$this between(string $startTime, string $endTime)

Schedule the event to run between start and end time.

Parameters

string $startTime
string $endTime

Return Value

$this

$this unlessBetween(string $startTime, string $endTime)

Schedule the event to not run between start and end time.

Parameters

string $startTime
string $endTime

Return Value

$this

$this everySecond()

Schedule the event to run every second.

Return Value

$this

$this everyTwoSeconds()

Schedule the event to run every two seconds.

Return Value

$this

$this everyFiveSeconds()

Schedule the event to run every five seconds.

Return Value

$this

$this everyTenSeconds()

Schedule the event to run every ten seconds.

Return Value

$this

$this everyFifteenSeconds()

Schedule the event to run every fifteen seconds.

Return Value

$this

$this everyTwentySeconds()

Schedule the event to run every twenty seconds.

Return Value

$this

$this everyThirtySeconds()

Schedule the event to run every thirty seconds.

Return Value

$this

protected $this repeatEvery(int<1, 59> $seconds)

Schedule the event to run multiple times per minute.

Parameters

int<1, 59> $seconds

Return Value

$this

Exceptions

InvalidArgumentException

$this everyMinute()

Schedule the event to run every minute.

Return Value

$this

$this everyTwoMinutes()

Schedule the event to run every two minutes.

Return Value

$this

$this everyThreeMinutes()

Schedule the event to run every three minutes.

Return Value

$this

$this everyFourMinutes()

Schedule the event to run every four minutes.

Return Value

$this

$this everyFiveMinutes()

Schedule the event to run every five minutes.

Return Value

$this

$this everyTenMinutes()

Schedule the event to run every ten minutes.

Return Value

$this

$this everyFifteenMinutes()

Schedule the event to run every fifteen minutes.

Return Value

$this

$this everyThirtyMinutes()

Schedule the event to run every thirty minutes.

Return Value

$this

$this hourly()

Schedule the event to run hourly.

Return Value

$this

$this hourlyAt(array|string|int<0, 59>|array<int<0, 59>> $offset)

Schedule the event to run hourly at a given offset in the hour.

Parameters

array|string|int<0, 59>|array<int<0, 59>> $offset

Return Value

$this

$this everyOddHour(array|string|int $offset = 0)

Schedule the event to run every odd hour.

Parameters

array|string|int $offset

Return Value

$this

$this everyTwoHours(array|string|int $offset = 0)

Schedule the event to run every two hours.

Parameters

array|string|int $offset

Return Value

$this

$this everyThreeHours(array|string|int $offset = 0)

Schedule the event to run every three hours.

Parameters

array|string|int $offset

Return Value

$this

$this everyFourHours(array|string|int $offset = 0)

Schedule the event to run every four hours.

Parameters

array|string|int $offset

Return Value

$this

$this everySixHours(array|string|int $offset = 0)

Schedule the event to run every six hours.

Parameters

array|string|int $offset

Return Value

$this

$this daily()

Schedule the event to run daily.

Return Value

$this

$this at(string $time)

Schedule the command at a given time.

Parameters

string $time

Return Value

$this

$this dailyAt(string $time)

Schedule the event to run daily at a given time (10:00, 19:30, etc).

Parameters

string $time

Return Value

$this

$this twiceDaily(int<0, 23> $first = 1, int<0, 23> $second = 13)

Schedule the event to run twice daily.

Parameters

int<0, 23> $first
int<0, 23> $second

Return Value

$this

$this twiceDailyAt(int<0, 23> $first = 1, int<0, 23> $second = 13, int<0, 59> $offset = 0)

Schedule the event to run twice daily at a given offset.

Parameters

int<0, 23> $first
int<0, 23> $second
int<0, 59> $offset

Return Value

$this

protected $this hourBasedSchedule(array|string|int<0, 59> $minutes, array|string|int<0, 23> $hours)

Schedule the event to run at the given minutes and hours.

Parameters

array|string|int<0, 59> $minutes
array|string|int<0, 23> $hours

Return Value

$this

$this weekdays()

Schedule the event to run only on weekdays.

Return Value

$this

$this weekends()

Schedule the event to run only on weekends.

Return Value

$this

$this mondays()

Schedule the event to run only on Mondays.

Return Value

$this

$this tuesdays()

Schedule the event to run only on Tuesdays.

Return Value

$this

$this wednesdays()

Schedule the event to run only on Wednesdays.

Return Value

$this

$this thursdays()

Schedule the event to run only on Thursdays.

Return Value

$this

$this fridays()

Schedule the event to run only on Fridays.

Return Value

$this

$this saturdays()

Schedule the event to run only on Saturdays.

Return Value

$this

$this sundays()

Schedule the event to run only on Sundays.

Return Value

$this

$this weekly()

Schedule the event to run weekly.

Return Value

$this

$this weeklyOn(mixed $dayOfWeek, string $time = '0:0')

Schedule the event to run weekly on a given day and time.

Parameters

mixed $dayOfWeek
string $time

Return Value

$this

$this monthly()

Schedule the event to run monthly.

Return Value

$this

$this monthlyOn(int<1, 31> $dayOfMonth = 1, string $time = '0:0')

Schedule the event to run monthly on a given day and time.

Parameters

int<1, 31> $dayOfMonth
string $time

Return Value

$this

$this twiceMonthly(int<1, 31> $first = 1, int<1, 31> $second = 16, string $time = '0:0')

Schedule the event to run twice monthly at a given time.

Parameters

int<1, 31> $first
int<1, 31> $second
string $time

Return Value

$this

$this lastDayOfMonth(string $time = '0:0')

Schedule the event to run on the last day of the month.

Parameters

string $time

Return Value

$this

$this daysOfMonth(array<int<1, 31>>|int<1, 31> ...$days)

Schedule the event to run on specific days of the month.

Parameters

array<int<1, 31>>|int<1, 31> ...$days

Return Value

$this

$this quarterly()

Schedule the event to run quarterly.

Return Value

$this

$this quarterlyOn(int $dayOfQuarter = 1, string $time = '0:0')

Schedule the event to run quarterly on a given day and time.

Parameters

int $dayOfQuarter
string $time

Return Value

$this

$this yearly()

Schedule the event to run yearly.

Return Value

$this

$this yearlyOn(int $month = 1, int<1, 31>|string $dayOfMonth = 1, string $time = '0:0')

Schedule the event to run yearly on a given month, day, and time.

Parameters

int $month
int<1, 31>|string $dayOfMonth
string $time

Return Value

$this

$this days(mixed $days)

Set the days of the week the command should run on.

Parameters

mixed $days

Return Value

$this

$this timezone(UnitEnum|DateTimeZone|string $timezone)

Set the timezone the date should be evaluated on.

Parameters

UnitEnum|DateTimeZone|string $timezone

Return Value

$this

protected $this spliceIntoPosition(int $position, string|int $value)

Splice the given value into the given position of the expression.

Parameters

int $position
string|int $value

Return Value

$this

__construct(Schedule $schedule)

Create a new pending event attributes instance.

Parameters

Schedule $schedule

void mergeAttributes(Event $event)

Merge the current attributes into the given event.

Parameters

Event $event

Return Value

void

mixed __call(string $method, array $parameters)

Proxy missing methods onto the underlying schedule.

Parameters

string $method
array $parameters

Return Value

mixed

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.