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

[8.x] Add yearlyOn() method to scheduler #34728

Merged
merged 2 commits into from Oct 7, 2020
Merged

[8.x] Add yearlyOn() method to scheduler #34728

merged 2 commits into from Oct 7, 2020

Conversation

u01jmg3
Copy link
Contributor

@u01jmg3 u01jmg3 commented Oct 7, 2020

Premise

I need to run a task once a year on a specific month (when the university term ends). Currently there is no expressive way to accomplish this with the available frequency options.

As weeklyOn($day, $time) and monthlyOn($day, $time) already exist, I simply used them as a guide and created yearlyOn($month, $day, $time).

// https://crontab.guru/#0_0_1_7_*
// At 00:00 on day-of-month 1 in July.

// Before
$schedule->cron('0 0 1 7 *');

// After
$schedule->yearlyOn(7);

@GrahamCampbell GrahamCampbell changed the title Add yearlyOn() method to scheduler [8.x] Add yearlyOn() method to scheduler Oct 7, 2020
@GrahamCampbell
Copy link
Member

@GrahamCampbell GrahamCampbell commented Oct 7, 2020

I suppose other use cases for this would be generation of annual tax documents, and the like.

@taylorotwell taylorotwell merged commit 6d5f3d9 into laravel:8.x Oct 7, 2020
7 checks passed
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.

None yet

3 participants