Download the PHP package luedtke/laravel-holiday-facade without Composer
On this page you can find all versions of the php package luedtke/laravel-holiday-facade. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download luedtke/laravel-holiday-facade
More information about luedtke/laravel-holiday-facade
Files in luedtke/laravel-holiday-facade
Package laravel-holiday-facade
Short Description Public holiday lookups for Laravel with multi-country driver support, Bundesland filtering, observance/strict mode and translation in five languages.
License MIT
Informations about the package laravel-holiday-facade
Laravel Holiday Facade
A Laravel package for working with public holidays across multiple countries. Provides a clean facade API with multi-language support, region/state filtering, strict mode, and fully customisable holidays via config.
Requirements
- PHP ^8.2
- Laravel ^13.0
Installation
The service provider is auto-discovered. Publish the config file:
Optionally publish the translation files if you want to customise holiday names:
Configuration
Basic Usage
Switching Drivers
Use the driver() method to switch country at runtime:
Supported Countries
| Driver | Country | Regional holidays |
|---|---|---|
germany |
Germany | Yes — 16 Bundesländer |
swedish |
Sweden | No |
finnish |
Finland | No |
netherlands |
Netherlands | No |
State / Region Filtering (Germany)
Germany has regional public holidays that apply only to specific Bundesländer. Pass a state code to filter:
Set a permanent default state via config or .env so you never have to pass it explicitly:
Strict Mode
By default, HolidayType::Observance days (e.g. Christmas Eve, Midsummer Eve, New Year's Eve) are excluded from semantic checks like isHoliday() and next() because they are not statutory days off.
Pass strict: false to include them:
Default $strict per method:
true (excludes observances) |
false (includes observances) |
|---|---|
isHoliday, isWorkday, nextWorkday |
getHolidays, getHolidaysBetween |
next, previous, countHolidays |
getHoliday, isHolidayByName |
Translations
Every holiday has a stable translation key. Call translate() on any Holiday value object to get the name in a different language:
Supported locales: de, en, fi, nl, sv
Set the default translation locale in your .env:
Override individual translation files after publishing:
Custom Holidays
Add company-specific or one-time holidays to config/holiday.custom. They are automatically merged into every driver result.
Supported types: public, observance, custom
Holiday Value Object
Every method returns (or works with) a Holiday value object:
Testing
License
This package is open-sourced software licensed under the MIT license.