class
CallbackEvent extends Event (View source)
Properties
string
|
$command |
The command string. |
from Event |
string
|
$expression |
The cron expression representing the event's frequency. |
from Event |
DateTimeZone|string
|
$timezone |
The timezone the date should be evaluated on. |
from Event |
string
|
$user |
The user the command should run as. |
from Event |
array
|
$environments |
The list of environments the command should run under. |
from Event |
bool
|
$evenInMaintenanceMode |
Indicates if the command should run in maintenance mode. |
from Event |
bool
|
$withoutOverlapping |
Indicates if the command should not overlap itself. |
from Event |
string
|
$output |
The location that output should be sent to. |
from Event |
string
|
$description |
The human readable description of the event. |
from Event |
Methods
void
__construct(
string $callback,
array $parameters = array())
Create a new event instance.
bool
isDue(
Application $app)
Determine if the given event should run based on the Cron expression.
bool
runsInEnvironment(
string $environment)
Determine if the event runs in the given environment.
cron(
string $expression)
The Cron expression representing the event's frequency.
hourly()
Schedule the event to run hourly.
daily()
Schedule the event to run daily.
at(
string $time)
Schedule the command at a given time.
dailyAt(
string $time)
Schedule the event to run daily at a given time (10:00, 19:30, etc).
twiceDaily(
int $first = 1,
int $second = 13)
Schedule the event to run twice daily.
weekdays()
Schedule the event to run only on weekdays.
mondays()
Schedule the event to run only on Mondays.
tuesdays()
Schedule the event to run only on Tuesdays.
wednesdays()
Schedule the event to run only on Wednesdays.
thursdays()
Schedule the event to run only on Thursdays.
fridays()
Schedule the event to run only on Fridays.
saturdays()
Schedule the event to run only on Saturdays.
sundays()
Schedule the event to run only on Sundays.
weekly()
Schedule the event to run weekly.
weeklyOn(
int $day,
string $time = '0:0')
Schedule the event to run weekly on a given day and time.
monthly()
Schedule the event to run monthly.
monthlyOn(
int $day = 1,
string $time = '0:0')
Schedule the event to run monthly on a given day and time.
quarterly()
Schedule the event to run quarterly.
yearly()
Schedule the event to run yearly.
days(
array|mixed $days)
Set the days of the week the command should run on.
user(
string $user)
Set which user the command should run as.
environments(
array|mixed $environments)
Limit the environments the command should run in.
when(
Closure $callback)
Register a callback to further filter the schedule.
skip(
Closure $callback)
Register a callback to further filter the schedule.
sendOutputTo(
string $location,
bool $append = false)
Send the output of the command to a given location.
appendOutputTo(
string $location)
Append the output of the command to a given location.
emailOutputTo(
array|mixed $addresses,
bool $onlyIfOutputExists = false)
E-mail the results of the scheduled operation.
emailWrittenOutputTo(
array|mixed $addresses)
E-mail the results of the scheduled operation if it produces output.
pingBefore(
string $url)
Register a callback to ping a given URL before the job runs.
before(
Closure $callback)
Register a callback to be called before the operation.
thenPing(
string $url)
Register a callback to ping a given URL after the job runs.
after(
Closure $callback)
Register a callback to be called after the operation.
then(
Closure $callback)
Register a callback to be called after the operation.
name(
string $description)
Set the human-friendly description of the event.
description(
string $description)
Set the human-friendly description of the event.
Details
void
__construct(
string $callback,
array $parameters = array())
Create a new event instance.
string
buildCommand()
Build the command string.
Determine if the given event should run based on the Cron expression.
Determine if the filters pass for the event.
bool
runsInEnvironment(
string $environment)
Determine if the event runs in the given environment.
bool
runsInMaintenanceMode()
Determine if the event runs in maintenance mode.
$this
cron(
string $expression)
The Cron expression representing the event's frequency.
$this
hourly()
Schedule the event to run hourly.
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 $first = 1,
int $second = 13)
Schedule the event to run twice daily.
$this
weekdays()
Schedule the event to run only on weekdays.
$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(
int $day,
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 $day = 1,
string $time = '0:0')
Schedule the event to run monthly on a given day and time.
$this
quarterly()
Schedule the event to run quarterly.
$this
yearly()
Schedule the event to run yearly.
$this
everyMinute()
Schedule the event to run every minute.
$this
everyFiveMinutes()
Schedule the event to run every five minutes.
$this
everyTenMinutes()
Schedule the event to run every ten minutes.
$this
everyThirtyMinutes()
Schedule the event to run every thirty minutes.
$this
days(
array|mixed $days)
Set the days of the week the command should run on.
Set the timezone the date should be evaluated on.
$this
user(
string $user)
Set which user the command should run as.
$this
environments(
array|mixed $environments)
Limit the environments the command should run in.
$this
evenInMaintenanceMode()
State that the command should run even in maintenance mode.
$this
withoutOverlapping()
Do not allow the event to overlap each other.
Register a callback to further filter the schedule.
Register a callback to further filter the schedule.
$this
sendOutputTo(
string $location,
bool $append = false)
Send the output of the command to a given location.
$this
appendOutputTo(
string $location)
Append the output of the command to a given location.
$this
emailOutputTo(
array|mixed $addresses,
bool $onlyIfOutputExists = false)
E-mail the results of the scheduled operation.
$this
emailWrittenOutputTo(
array|mixed $addresses)
E-mail the results of the scheduled operation if it produces output.
$this
pingBefore(
string $url)
Register a callback to ping a given URL before the job runs.
Register a callback to be called before the operation.
$this
thenPing(
string $url)
Register a callback to ping a given URL after the job runs.
Register a callback to be called after the operation.
Register a callback to be called after the operation.
$this
name(
string $description)
Set the human-friendly description of the event.
$this
description(
string $description)
Set the human-friendly description of the event.
string
getSummaryForDisplay()
Get the summary of the event for display.
string
getExpression()
Get the Cron expression for the event.