Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Holidays Laravel Package

spatie/holidays

Calculate public holidays by country (ISO alpha-2) with a simple API. Get an array of Holiday objects including localized name, CarbonImmutable date, and type (e.g., national). Supports multiple countries and is easy to extend by adding new country definitions.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Expanded Regional Support: Addition of Ethiopian holidays (including locale support) broadens the package’s applicability to global applications, particularly those serving African markets or multi-region enterprises.
  • Still Lightweight & Modular: No architectural changes; remains dependency-light (PHP 8.4+, Carbon) and Laravel-native.
  • Domain-Specific Strengths: Continues to excel for date-based business logic (e.g., payroll, scheduling) with deterministic holiday data.
  • Extensibility: Community-driven additions (e.g., Ethiopian holidays) reinforce the package’s open-source scalability for niche regions.

Integration Feasibility

  • Zero Database Dependency: Unchanged; holidays remain precomputed and code-first.
  • Enhanced Locale Support: Ethiopian holidays now include translations, reducing i18n boilerplate for apps targeting Amharic (am) or other localizations.
  • Carbon & Laravel Compatibility: No changes to core functionality; CarbonImmutable and JSON serialization remain intact.
  • Backward Compatibility: Ethiopian holidays are additive; existing integrations for supported countries/regions remain unaffected.

Technical Risk

  • Regional Complexity Mitigated: Ethiopian holidays address a previously unsupported region, reducing customization needs for apps serving Ethiopia.
  • Static Data Limitations: Still requires manual updates for dynamic rules (e.g., religious holidays like Easter) or new national holidays.
  • Performance: Minimal impact; Ethiopian data is precomputed and lazy-loaded.
  • PHP 8.4+ Constraint: Unchanged; no breaking changes to version requirements.

Key Questions

  1. Use Case Scope:
    • Does the application now require Ethiopian holiday support for user-facing calendars, payroll, or leave management?
    • Are there other unsupported regions (e.g., Middle Eastern, Asian countries) that may need similar community-driven additions?
  2. Data Freshness:
    • How critical is Ethiopian holiday accuracy (e.g., religious observances like Timket) compared to other regions?
    • Should a cache layer (e.g., Redis) be implemented for Ethiopian holidays to optimize performance?
  3. Testing Coverage:
    • Should tests now include Ethiopian-specific edge cases (e.g., Ethiopian calendar dates, leap years)?
    • Are there locale-specific validation needs for Amharic translations?
  4. Customization Needs:
    • Will the team leverage this update to standardize holiday logic for all regions or focus on Ethiopian-specific workflows?
  5. Legacy Support:
    • If using PHP <8.4, does the Ethiopian addition increase urgency to upgrade (e.g., for locale support)?

Integration Approach

Stack Fit

  • Laravel Ecosystem: Unchanged; Ethiopian holidays integrate seamlessly with:
    • Service Providers: Register via config/app.php or a custom provider.
    • Carbon: Returns CarbonImmutable instances for Ethiopian dates.
    • Localization: Supports am (Amharic) translations via Laravel’s App::setLocale().
    • APIs: JSON-serializable output works with Laravel’s responses or GraphQL.
  • Non-Laravel PHP: Works in any PHP 8.4+ app, but loses Laravel-specific optimizations (e.g., caching).

Migration Path

  1. Composer Update:
    composer update spatie/holidays
    
  2. Configuration:
    • Publish config (if needed) to enable Ethiopian locale:
      'locales' => [
          'am' => 'am', // Amharic support
      ],
      
  3. Usage Patterns:
    • Ethiopian Holidays:
      $ethiopianHolidays = Holidays::for('et')->get(); // Ethiopian country code
      $ethiopianHolidays->filter(fn (Holiday $h) => $h->name->contains('Timket'));
      
    • Locale-Specific Names:
      Holidays::for('et')->setLocale('am')->get(); // Amharic translations
      
  4. Backward Compatibility:
    • Existing country codes (e.g., us, de) remain unchanged.
    • No breaking changes to method signatures or return types.

Compatibility

  • Laravel Versions: Tested with Laravel 10+ (PHP 8.4+). Ethiopian additions do not affect older stacks.
  • Date Libraries: Still requires nesbot/carbon (Laravel includes this by default).
  • Database: No changes; data remains code-first.
  • Caching: Unchanged; can wrap Ethiopian holiday calls in Laravel’s cache (e.g., Cache::remember()).

Sequencing

  1. Phase 1: Core Integration
    • Update the package and validate Ethiopian holiday retrieval:
      $holidays = Holidays::for('et')->get();
      
    • Test locale-specific names (setLocale('am')).
  2. Phase 2: Business Logic
    • Integrate Ethiopian holidays into payroll/leave systems (e.g., exclude from workdays).
    • Add regional support for other unsupported countries if needed.
  3. Phase 3: Optimization
    • Cache Ethiopian holiday data for high-traffic endpoints (e.g., calendars).
    • Example:
      Cache::remember("holidays:et:2024", 31536000, fn () => Holidays::for('et', 2024)->get());
      
  4. Phase 4: Monitoring
    • Log Ethiopian holiday-related errors (e.g., missing translations).
    • Set up alerts for rule changes (e.g., new Ethiopian national holidays).

Operational Impact

Maintenance

  • Low Overhead: Ethiopian additions are precomputed and static; no runtime changes.
  • Update Frequency:
    • Major Releases: Rare (e.g., PHP 8.5+ or Laravel 11+).
    • Holiday Updates: Manual or via community PRs (e.g., new Ethiopian holidays).
  • Deprecation Risk: Low; MIT-licensed with active development (last release: 2026).

Support

  • Documentation: Updated README now includes Ethiopian examples and locale usage.
  • Community: Active GitHub repo (now with Ethiopian contributions; 397 stars).
  • Debugging: Clear error messages for unsupported locales or invalid country codes.
  • Custom Support: Spatie’s paid support covers Ethiopian-specific edge cases.

Scaling

  • Performance:
    • Micro-optimized: Ethiopian data is precomputed; no runtime calculations.
    • Scalability: Stateless design; scales horizontally with Laravel.
  • Data Growth:
    • Adding Ethiopian holidays increases memory slightly but remains negligible.
    • Lazy-loading recommended for apps supporting many regions.
  • Caching:
    • Recommended: Cache Ethiopian holiday lists (e.g., Redis TTL: 1 year).
    • Example:
      Cache::remember("holidays:et:2024", 31536000, fn () => Holidays::for('et', 2024)->get());
      

Failure Modes

Scenario Impact Mitigation
Unsupported country Returns empty array Fallback to default country or error.
Invalid date range Empty result Validate inputs (e.g., Carbon::parse).
Locale translation missing Falls back to default language Pre-load translations or handle gracefully.
Ethiopian-specific errors Missing holidays/incorrect dates Validate against Ethiopian calendar.
PHP 8.4+ requirement Breaks on older stacks Upgrade PHP or fork the package.
Holiday rule changes Outdated Ethiopian data Monitor changelogs; update proactively.

Ramp-Up

  • Developer Onboarding:
    • Easy: Basic Ethiopian usage (Holidays::for('et')->get()) takes <10 minutes.
    • Advanced: Locale-specific queries (setLocale('am')) require ~30 minutes.
  • Testing:
    • Unit Tests: Validate Ethiopian holidays for critical years (e.g., 2023–2025).
    • Edge Cases: Test Ethiopian calendar dates (e.g., Enkutatash, leap years).
  • Training:
    • Docs: Updated README covers Ethiopian examples and locale support.
    • Workshops: Pair with a team member for complex integrations (e.g., payroll systems).
  • Knowledge Transfer:
    • Document internal patterns (e.g., "Ethiopian holidays use et country code").
    • Assign a "holiday logic owner" to handle Ethiopian-specific updates (e.g., new religious observances).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai