Skip to content

[5.4] nextDue for Schedule Event#19537

Merged
taylorotwell merged 2 commits into
laravel:5.4from
decadence:nextDue5.4
Jun 9, 2017
Merged

[5.4] nextDue for Schedule Event#19537
taylorotwell merged 2 commits into
laravel:5.4from
decadence:nextDue5.4

Conversation

@decadence
Copy link
Copy Markdown
Contributor

Added a wrapper that allows find out when the next Carbon time Event will run.
For example this allows you to list events and their next run time in schedule method for debug:

protected function schedule(Schedule $schedule)
{
    $schedule->command('inspire')->yearly()->name("Inspire");

    foreach ($schedule->events() as $event) {
        echo $event->description . " will run next time at " . $event->nextDue()->toDateTimeString() . "\n";
    }
}

@decadence decadence changed the title nextDue for Schedule Event [5.4] nextDue for Schedule Event Jun 9, 2017
@taylorotwell taylorotwell merged commit 67f5cb9 into laravel:5.4 Jun 9, 2017
@decadence decadence deleted the nextDue5.4 branch June 9, 2017 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants