Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4] nextDue for Schedule Event #19537

Merged
merged 2 commits into from
Jun 9, 2017
Merged

[5.4] nextDue for Schedule Event #19537

merged 2 commits into from
Jun 9, 2017

Conversation

decadence
Copy link
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