Skip to content

Added FrequencyEnum for Reset Frequency Values #1

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

Closed
wants to merge 2 commits into from

Conversation

giagara
Copy link

@giagara giagara commented Jun 21, 2024

Changes:

Introduced a new enum FrequencyEnum in the file src/Enum/FrequencyEnum.php.
The FrequencyEnum defines the possible values for the reset_frequency column.
Added the following values in the enum:

  • EVERY_SECOND = 'every second'
  • EVERY_MINUTE = 'every minute'
  • EVERY_HOUR = 'every hour'
  • EVERY_DAY = 'every day'
  • EVERY_WEEK = 'every week'
  • EVERY_TWO_WEEKS = 'every two weeks'
  • EVERY_MONTH = 'every month'
  • EVERY_QUARTER = 'every quarter'
  • EVERY_SIX_MONTHS = 'every six months'
  • EVERY_YEAR = 'every year'

Benefits:

Centralized management of reset frequency values.
Simplifies handling time-based operations with the integration of Carbon date-time library.
Ensures consistency and reduces the risk of errors associated with manual time calculations.

Please review the changes and let me know if any further modifications are needed.

@nabilhassen
Copy link
Owner

Enums are not supported in PHP 8.0 and PHP 8.0 is required for Laravel 8 and 9.
Would you go further to customize for PHP 8.0 or shall I close this PR ?

@giagara
Copy link
Author

giagara commented Jun 22, 2024

I didn't check the compatibility, that's my fault.
The next week I can't work on it.
You can keep it open and I'll work on it ASAP.

@giagara giagara marked this pull request as draft June 22, 2024 18:52
@nabilhassen nabilhassen added the draft Needs more work and/or discussion label Jul 5, 2024
@nabilhassen nabilhassen closed this Nov 8, 2024
@aneeskhan47
Copy link

aneeskhan47 commented Jan 14, 2025

@giagara @nabilhassen

This is a great package I found through Laravel Daily youtube channel. I think we can make use of php class Frequency (that what we used prior of enums introduced in php 8.1).

This would work and backward compatible too.

@nabilhassen
Copy link
Owner

hey @aneeskhan47, please feel free to submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
draft Needs more work and/or discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants