Skip to content

Commit

Permalink
Merge branch 'feature/scheduling-environment-constraints' of https://…
Browse files Browse the repository at this point in the history
…github.com/fetzi/docs into fetzi-feature/scheduling-environment-constraints
  • Loading branch information
taylorotwell committed Oct 8, 2018
2 parents d058af0 + c10bed1 commit e883489
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scheduling.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ Method | Description
`->saturdays();` | Limit the task to Saturday
`->between($start, $end);` | Limit the task to run between start and end times
`->when(Closure);` | Limit the task based on a truth test
`->environments($env);` | Limit the task to be only executed on a certain environment

#### Between Time Constraints

Expand Down Expand Up @@ -182,6 +183,14 @@ The `skip` method may be seen as the inverse of `when`. If the `skip` method ret

When using chained `when` methods, the scheduled command will only execute if all `when` conditions return `true`.

#### Environment Constraints

The `environments` method may be used to execute tasks only on certain environments. Only if the current environment matches the given environment or the list of environments the task will be executed.

$schedule->command('emails:send')
->daily()
->environments(['staging', 'production']);

<a name="timezones"></a>
### Timezones

Expand Down

0 comments on commit e883489

Please sign in to comment.