Event
class Event (View source)
Properties
string | $command | The command string. | |
string | $expression | The cron expression representing the event's frequency. | |
DateTimeZone|string | $timezone | The timezone the date should be evaluated on. | |
string | $user | The user the command should run as. | |
array | $environments | The list of environments the command should run under. | |
bool | $evenInMaintenanceMode | Indicates if the command should run in maintenance mode. | |
bool | $withoutOverlapping | Indicates if the command should not overlap itself. | |
string | $output | The location that output should be sent to. | |
string | $description | The human readable description of the event. |
Methods
Create a new event instance.
Build the command string.
Determine if the event runs in the given environment.
Determine if the event runs in maintenance mode.
The Cron expression representing the event's frequency.
Schedule the event to run hourly.
Schedule the event to run daily.
Schedule the command at a given time.
Schedule the event to run daily at a given time (10:00, 19:30, etc).
Schedule the event to run twice daily.
Schedule the event to run only on weekdays.
Schedule the event to run only on Mondays.
Schedule the event to run only on Tuesdays.
Schedule the event to run only on Wednesdays.
Schedule the event to run only on Thursdays.
Schedule the event to run only on Fridays.
Schedule the event to run only on Saturdays.
Schedule the event to run only on Sundays.
Schedule the event to run weekly.
Schedule the event to run weekly on a given day and time.
Schedule the event to run monthly.
Schedule the event to run monthly on a given day and time.
Schedule the event to run quarterly.
Schedule the event to run yearly.
Schedule the event to run every minute.
Schedule the event to run every five minutes.
Schedule the event to run every ten minutes.
Schedule the event to run every thirty minutes.
Set the days of the week the command should run on.
Set which user the command should run as.
Limit the environments the command should run in.
State that the command should run even in maintenance mode.
Do not allow the event to overlap each other.
Send the output of the command to a given location.
Append the output of the command to a given location.
E-mail the results of the scheduled operation.
E-mail the results of the scheduled operation if it produces output.
Register a callback to ping a given URL before the job runs.
Register a callback to ping a given URL after the job runs.
Set the human-friendly description of the event.
Set the human-friendly description of the event.
Get the summary of the event for display.
Get the Cron expression for the event.
Details
at line line 231
bool
isDue(
Application $app)
Determine if the given event should run based on the Cron expression.
at line line 286
bool
runsInEnvironment(
string $environment)
Determine if the event runs in the given environment.
at line line 307
$this
cron(
string $expression)
The Cron expression representing the event's frequency.
at line line 351
$this
dailyAt(
string $time)
Schedule the event to run daily at a given time (10:00, 19:30, etc).
at line line 366
$this
twiceDaily(
int $first = 1,
int $second = 13)
Schedule the event to run twice daily.
at line line 471
$this
weeklyOn(
int $day,
string $time = '0:0')
Schedule the event to run weekly on a given day and time.
at line line 495
$this
monthlyOn(
int $day = 1,
string $time = '0:0')
Schedule the event to run monthly on a given day and time.
at line line 581
$this
timezone(
DateTimeZone|string $timezone)
Set the timezone the date should be evaluated on.
at line line 607
$this
environments(
array|mixed $environments)
Limit the environments the command should run in.
at line line 619
$this
evenInMaintenanceMode()
State that the command should run even in maintenance mode.
at line line 673
$this
sendOutputTo(
string $location,
bool $append = false)
Send the output of the command to a given location.
at line line 688
$this
appendOutputTo(
string $location)
Append the output of the command to a given location.
at line line 702
$this
emailOutputTo(
array|mixed $addresses,
bool $onlyIfOutputExists = false)
E-mail the results of the scheduled operation.
at line line 723
$this
emailWrittenOutputTo(
array|mixed $addresses)
E-mail the results of the scheduled operation if it produces output.
at line line 773
$this
pingBefore(
string $url)
Register a callback to ping a given URL before the job runs.
at line line 786
$this
before(
Closure $callback)
Register a callback to be called before the operation.
at line line 799
$this
thenPing(
string $url)
Register a callback to ping a given URL after the job runs.
at line line 812
$this
after(
Closure $callback)
Register a callback to be called after the operation.
at line line 823
$this
then(
Closure $callback)
Register a callback to be called after the operation.
at line line 847
$this
description(
string $description)
Set the human-friendly description of the event.