class CallbackEvent extends Event (View source)
Macroable | |
ManagesFrequencies | |
ReflectsClosures |
static protected array | $macros | The registered string macros. | from Macroable |
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 |
bool | $onOneServer | Indicates if the command should only be allowed to run on one server for each cron expression. | from Event |
int | $expiresAt | The amount of time the mutex should be valid. | from Event |
bool | $runInBackground | Indicates if the command should run in background. | from Event |
protected array | $filters | The array of filter callbacks. | from Event |
protected array | $rejects | The array of reject callbacks. | from Event |
string | $output | The location that output should be sent to. | from Event |
bool | $shouldAppendOutput | Indicates whether output should be appended. | from Event |
protected array | $beforeCallbacks | The array of callbacks to be run before the event is started. | from Event |
protected array | $afterCallbacks | The array of callbacks to be run after the event is finished. | from Event |
string | $description | The human readable description of the event. | from Event |
EventMutex | $mutex | The event mutex implementation. | from Event |
int|null | $exitCode | The exit status code of the command. | from Event |
protected string | $callback | The callback to call. | |
protected array | $parameters | The parameters to pass to the method. |
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 |
$this | cron(string $expression) The Cron expression representing the event's frequency. | from ManagesFrequencies |
$this | between(string $startTime, string $endTime) Schedule the event to run between start and end time. | from ManagesFrequencies |
$this | unlessBetween(string $startTime, string $endTime) Schedule the event to not run between start and end time. | from ManagesFrequencies |
$this | everyMinute() Schedule the event to run every minute. | from ManagesFrequencies |
$this | everyTwoMinutes() Schedule the event to run every two minutes. | from ManagesFrequencies |
$this | everyThreeMinutes() Schedule the event to run every three minutes. | from ManagesFrequencies |
$this | everyFourMinutes() Schedule the event to run every four minutes. | from ManagesFrequencies |
$this | everyFiveMinutes() Schedule the event to run every five minutes. | from ManagesFrequencies |
$this | everyTenMinutes() Schedule the event to run every ten minutes. | from ManagesFrequencies |
$this | everyFifteenMinutes() Schedule the event to run every fifteen minutes. | from ManagesFrequencies |
$this | everyThirtyMinutes() Schedule the event to run every thirty minutes. | from ManagesFrequencies |
$this | hourly() Schedule the event to run hourly. | from ManagesFrequencies |
$this | hourlyAt(array|int $offset) Schedule the event to run hourly at a given offset in the hour. | from ManagesFrequencies |
$this | everyTwoHours() Schedule the event to run every two hours. | from ManagesFrequencies |
$this | everyThreeHours() Schedule the event to run every three hours. | from ManagesFrequencies |
$this | everyFourHours() Schedule the event to run every four hours. | from ManagesFrequencies |
$this | everySixHours() Schedule the event to run every six hours. | from ManagesFrequencies |
$this | daily() Schedule the event to run daily. | from ManagesFrequencies |
$this | at(string $time) Schedule the command at a given time. | from ManagesFrequencies |
$this | dailyAt(string $time) Schedule the event to run daily at a given time (10:00, 19:30, etc). | from ManagesFrequencies |
$this | twiceDaily(int $first = 1, int $second = 13) Schedule the event to run twice daily. | from ManagesFrequencies |
$this | weekdays() Schedule the event to run only on weekdays. | from ManagesFrequencies |
$this | weekends() Schedule the event to run only on weekends. | from ManagesFrequencies |
$this | mondays() Schedule the event to run only on Mondays. | from ManagesFrequencies |
$this | tuesdays() Schedule the event to run only on Tuesdays. | from ManagesFrequencies |
$this | wednesdays() Schedule the event to run only on Wednesdays. | from ManagesFrequencies |
$this | thursdays() Schedule the event to run only on Thursdays. | from ManagesFrequencies |
$this | fridays() Schedule the event to run only on Fridays. | from ManagesFrequencies |
$this | saturdays() Schedule the event to run only on Saturdays. | from ManagesFrequencies |
$this | sundays() Schedule the event to run only on Sundays. | from ManagesFrequencies |
$this | weekly() Schedule the event to run weekly. | from ManagesFrequencies |
$this | weeklyOn(int $dayOfWeek, string $time = '0:0') Schedule the event to run weekly on a given day and time. | from ManagesFrequencies |
$this | monthly() Schedule the event to run monthly. | from ManagesFrequencies |
$this | monthlyOn(int $dayOfMonth = 1, string $time = '0:0') Schedule the event to run monthly on a given day and time. | from ManagesFrequencies |
$this | twiceMonthly(int $first = 1, int $second = 16, string $time = '0:0') Schedule the event to run twice monthly at a given time. | from ManagesFrequencies |
$this | lastDayOfMonth(string $time = '0:0') Schedule the event to run on the last day of the month. | from ManagesFrequencies |
$this | quarterly() Schedule the event to run quarterly. | from ManagesFrequencies |
$this | yearly() Schedule the event to run yearly. | from ManagesFrequencies |
$this | yearlyOn(int $month = 1, int|string $dayOfMonth = 1, string $time = '0:0') Schedule the event to run yearly on a given month, day, and time. | from ManagesFrequencies |
$this | days(array|mixed $days) Set the days of the week the command should run on. | from ManagesFrequencies |
$this | timezone(DateTimeZone|string $timezone) Set the timezone the date should be evaluated on. | from ManagesFrequencies |
$this | spliceIntoPosition(int $position, string $value) Splice the given value into the given position of the expression. | from ManagesFrequencies |
array | closureParameterTypes(Closure $closure) Get the class names / types of the parameters of the given Closure. | from ReflectsClosures |
string | firstClosureParameterType(Closure $closure) Get the class name of the first parameter of the given Closure. | from ReflectsClosures |
void | __construct(EventMutex $mutex, string $callback, array $parameters = [], DateTimeZone|string|null $timezone = null) Create a new event instance. | |
string | getDefaultOutput() Get the default output depending on the OS. | from Event |
void | run(Container $container) Run the given event. | |
string | mutexName() Get the mutex name for the scheduled command. | |
void | runCommandInForeground(Container $container) Run the command in the foreground. | from Event |
void | runCommandInBackground(Container $container) Run the command in the background. | from Event |
void | callBeforeCallbacks(Container $container) Call all of the "before" callbacks for the event. | from Event |
void | callAfterCallbacks(Container $container) Call all of the "after" callbacks for the event. | from Event |
void | callAfterCallbacksWithExitCode(Container $container, int $exitCode) Call all of the "after" callbacks for the event. | from Event |
string | buildCommand() Build the command string. | from Event |
bool | isDue(Application $app) Determine if the given event should run based on the Cron expression. | from Event |
bool | runsInMaintenanceMode() Determine if the event runs in maintenance mode. | from Event |
bool | expressionPasses() Determine if the Cron expression passes. | from Event |
bool | runsInEnvironment(string $environment) Determine if the event runs in the given environment. | from Event |
bool | filtersPass(Application $app) Determine if the filters pass for the event. | from Event |
$this | storeOutput() Ensure that the output is stored on disk in a log file. | from Event |
$this | sendOutputTo(string $location, bool $append = false) Send the output of the command to a given location. | from Event |
$this | appendOutputTo(string $location) Append the output of the command to a given location. | from Event |
$this | emailOutputTo(array|mixed $addresses, bool $onlyIfOutputExists = false) E-mail the results of the scheduled operation. | from Event |
$this | emailWrittenOutputTo(array|mixed $addresses) E-mail the results of the scheduled operation if it produces output. | from Event |
$this | emailOutputOnFailure(array|mixed $addresses) E-mail the results of the scheduled operation if it fails. | from Event |
void | ensureOutputIsBeingCaptured() Ensure that the command output is being captured. | from Event |
void | emailOutput(Mailer $mailer, array $addresses, bool $onlyIfOutputExists = false) E-mail the output of the event to the recipients. | from Event |
string | getEmailSubject() Get the e-mail subject line for output results. | from Event |
$this | pingBefore(string $url) Register a callback to ping a given URL before the job runs. | from Event |
$this | pingBeforeIf(bool $value, string $url) Register a callback to ping a given URL before the job runs if the given condition is true. | from Event |
$this | thenPing(string $url) Register a callback to ping a given URL after the job runs. | from Event |
$this | thenPingIf(bool $value, string $url) Register a callback to ping a given URL after the job runs if the given condition is true. | from Event |
$this | pingOnSuccess(string $url) Register a callback to ping a given URL if the operation succeeds. | from Event |
$this | pingOnFailure(string $url) Register a callback to ping a given URL if the operation fails. | from Event |
Closure | pingCallback(string $url) Get the callback that pings the given URL. | from Event |
$this | runInBackground() State that the command should run in background. | from Event |
$this | user(string $user) Set which user the command should run as. | from Event |
$this | environments(array|mixed $environments) Limit the environments the command should run in. | from Event |
$this | evenInMaintenanceMode() State that the command should run even in maintenance mode. | from Event |
$this | withoutOverlapping(int $expiresAt = 1440) 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 | when(Closure|bool $callback) Register a callback to further filter the schedule. | from Event |
$this | skip(Closure|bool $callback) Register a callback to further filter the schedule. | from Event |
$this | before(Closure $callback) Register a callback to be called before the operation. | from Event |
$this | after(Closure $callback) Register a callback to be called after the operation. | from Event |
$this | then(Closure $callback) Register a callback to be called after the operation. | from Event |
$this | thenWithOutput(Closure $callback, bool $onlyIfOutputExists = false) Register a callback that uses the output after the job runs. | from Event |
$this | onSuccess(Closure $callback) Register a callback to be called if the operation succeeds. | from Event |
$this | onSuccessWithOutput(Closure $callback, bool $onlyIfOutputExists = false) Register a callback that uses the output if the operation succeeds. | from Event |
$this | onFailure(Closure $callback) Register a callback to be called if the operation fails. | from Event |
$this | onFailureWithOutput(Closure $callback, bool $onlyIfOutputExists = false) Register a callback that uses the output if the operation fails. | from Event |
Closure | withOutputCallback(Closure $callback, bool $onlyIfOutputExists = false) Get a callback that provides output. | from Event |
$this | name(string $description) Set the human-friendly description of the event. | from Event |
$this | description(string $description) Set the human-friendly description of the event. | from Event |
string | getSummaryForDisplay() Get the summary of the event for display. | |
Carbon | nextRunDate(DateTimeInterface|string $currentTime = 'now', int $nth = 0, bool $allowCurrentDate = false) Determine the next due date for an event. | from Event |
string | getExpression() Get the Cron expression for the event. | from Event |
$this | preventOverlapsUsing(EventMutex $mutex) Set the event mutex implementation to be used. | from Event |
void | removeMutex() Clear the mutex for the event. |
Register a custom macro.
Mix another object into the class.
Checks if macro is registered.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
The Cron expression representing the event's frequency.
Schedule the event to run between start and end time.
Schedule the event to not run between start and end time.
Schedule the event to run every minute.
Schedule the event to run every two minutes.
Schedule the event to run every three minutes.
Schedule the event to run every four minutes.
Schedule the event to run every five minutes.
Schedule the event to run every ten minutes.
Schedule the event to run every fifteen minutes.
Schedule the event to run every thirty minutes.
Schedule the event to run hourly.
Schedule the event to run hourly at a given offset in the hour.
Schedule the event to run every two hours.
Schedule the event to run every three hours.
Schedule the event to run every four hours.
Schedule the event to run every six hours.
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 weekends.
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 twice monthly at a given time.
Schedule the event to run on the last day of the month.
Schedule the event to run quarterly.
Schedule the event to run yearly.
Schedule the event to run yearly on a given month, day, and time.
Set the days of the week the command should run on.
Set the timezone the date should be evaluated on.
Splice the given value into the given position of the expression.
Get the class names / types of the parameters of the given Closure.
Get the class name of the first parameter of the given Closure.
Create a new event instance.
Get the default output depending on the OS.
Run the given event.
Get the mutex name for the scheduled command.
Run the command in the foreground.
Run the command in the background.
Call all of the "before" callbacks for the event.
Call all of the "after" callbacks for the event.
Call all of the "after" callbacks for the event.
Build the command string.
Determine if the given event should run based on the Cron expression.
Determine if the event runs in maintenance mode.
Determine if the Cron expression passes.
Determine if the event runs in the given environment.
Determine if the filters pass for the event.
Ensure that the output is stored on disk in a log file.
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.
E-mail the results of the scheduled operation if it fails.
Ensure that the command output is being captured.
E-mail the output of the event to the recipients.
Get the e-mail subject line for output results.
Register a callback to ping a given URL before the job runs.
Register a callback to ping a given URL before the job runs if the given condition is true.
Register a callback to ping a given URL after the job runs.
Register a callback to ping a given URL after the job runs if the given condition is true.
Register a callback to ping a given URL if the operation succeeds.
Register a callback to ping a given URL if the operation fails.
Get the callback that pings the given URL.
State that the command should run in background.
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.
Allow the event to only run on one server for each cron expression.
Register a callback to further filter the schedule.
Register a callback to further filter the schedule.
Register a callback to be called before the operation.
Register a callback to be called after the operation.
Register a callback to be called after the operation.
Register a callback that uses the output after the job runs.
Register a callback to be called if the operation succeeds.
Register a callback that uses the output if the operation succeeds.
Register a callback to be called if the operation fails.
Register a callback that uses the output if the operation fails.
Get a callback that provides output.
Set the human-friendly description of the event.
Set the human-friendly description of the event.
Get the summary of the event for display.
Determine the next due date for an event.
Get the Cron expression for the event.
Set the event mutex implementation to be used.
Clear the mutex for the event.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Console/Scheduling/CallbackEvent.html