wendelladriel / cache-ttl-helper
Helper Enum for handling cache TTLs in a simple, easy and friendly way
Fund package maintenance!
WendellAdriel
www.paypal.me/wendelladriel
Installs: 4 601
Dependents: 0
Suggesters: 0
Security: 0
Stars: 19
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
- laravel/pint: ^1.11
- pestphp/pest: ^2.15
- phpstan/phpstan: ^1.10
README
Cache TTL Helper
Helper Enum for handling cache TTLs in a simple, easy and friendly wayInstallation
composer require wendelladriel/cache-ttl-helper
Usage
This package provides a simple Enum class with some helper methods to handle cache TTLs in a simple, easy and friendly way.
All methods are static, and they all return the TTL in seconds.
Methods available
use WendellAdriel\CacheTtlHelper\CacheTTL; CacheTTL::second(); // 1s CacheTTL::seconds(30); // 30s CacheTTL::minute(); // 60s CacheTTL::minutes(5); // 300s CacheTTL::hour(); // 3600s CacheTTL::hours(2); // 7200s CacheTTL::day(); // 86400s CacheTTL::days(3); // 259200s CacheTTL::week(); // 604800s CacheTTL::weeks(2); // 1209600s CacheTTL::month(); // 2592000s CacheTTL::months(6); // 15552000s CacheTTL::year(); // 31536000s CacheTTL::years(2); // 63072000s
Credits
Contributing
Check the Contributing Guide.