PHPackages                             spatie/holidays - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. spatie/holidays

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

spatie/holidays
===============

Calculate public holidays

1.24.0(3mo ago)392604.1k—1.7%208[1 issues](https://github.com/spatie/holidays/issues)[4 PRs](https://github.com/spatie/holidays/pulls)1MITPHPPHP ^8.1CI passing

Since Jan 15Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/spatie/holidays)[ Packagist](https://packagist.org/packages/spatie/holidays)[ Docs](https://github.com/spatie/holidays)[ GitHub Sponsors](https://github.com/spatie)[ RSS](/packages/spatie-holidays/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (41)Used By (1)

Calculate public holidays for a country
=======================================

[](#calculate-public-holidays-for-a-country)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cb4e70f321658e94927a61b9c4b83f97daee6d80f3d6fa9183f610eedc333c21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f686f6c69646179732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/holidays)[![Tests](https://camo.githubusercontent.com/650f4855c2a12bb78e8ec5068513b8059ec3e5ccc908c95d9a86f1d98515530c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f686f6c69646179732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/spatie/holidays/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/4a2dcdeabb68007da85320946077ec0b31f5d27f75b97197fdc1ed4c2a6bdfee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f686f6c69646179732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/holidays)

This package can calculate public holidays for a country.

```
use Spatie\Holidays\Holidays;

// returns an array of Belgian holidays
// for the current year
$holidays = Holidays::for('be')->get();
```

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/3adb44be83886be291891f152eac98653020672667ddf685008564e737ac470e/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f686f6c69646179732e6a70673f743d31)](https://spatie.be/github-ad-click/holidays)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require spatie/holidays
```

Supported countries
-------------------

[](#supported-countries)

We support the countries listed in [this directory](https://github.com/spatie/holidays/tree/main/src/Countries). If you want to add a country, please create a pull request.

Usage
-----

[](#usage)

You can get all holidays for a country by using the `get` method.

```
use Spatie\Holidays\Holidays;
use Spatie\Holidays\Countries\Belgium;

// returns an array of Belgian holidays
// for the current year
$holidays = Holidays::for(Belgium::make())->get();
```

Alternatively, you could also pass an [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) code to the `for` method. In case of region based holidays, these will not be included. Use a country class instead.

```
use Spatie\Holidays\Holidays;

// returns an array of Belgian holidays
// for the current year
$holidays = Holidays::for('be')->get();
```

### Getting holidays for a specific year

[](#getting-holidays-for-a-specific-year)

You can also pass a specific year.

```
use Spatie\Holidays\Holidays;

$holidays = Holidays::for(country: 'be', year: 2024)->get();
```

### Getting holidays between two dates

[](#getting-holidays-between-two-dates)

You can also get all holidays between two dates (inclusive).

```
use Spatie\Holidays\Holidays;

$holidays = Holidays::for('be')->getInRange('2023-06-01', '2024-05-31');
```

### Getting holidays in a specific language

[](#getting-holidays-in-a-specific-language)

```
$holidays = Holidays::for(country: 'be', locale: 'fr')->get();
```

If the locale is not supported for a country, an exception will be thrown.

### Determining if a date is a holiday

[](#determining-if-a-date-is-a-holiday)

If you need to see if a date is a holiday, you can use the `isHoliday` method.

```
use Spatie\Holidays\Holidays;

Holidays::for('be')->isHoliday('2024-01-01'); // true
```

### Getting the name of a holiday

[](#getting-the-name-of-a-holiday)

If you need the name of the holiday, you can use the `getName` method.

```
use Spatie\Holidays\Holidays;

Holidays::for('be')->getName('2024-01-01'); // Nieuwjaar
```

### Determining whether a country is supported

[](#determining-whether-a-country-is-supported)

To verify whether a country is supported, you can use the `has` method.

```
use Spatie\Holidays\Holidays;

Holidays::has('be'); // true
Holidays::has('unknown'); // false
```

Contributing
------------

[](#contributing)

This is a community driven package. If you find any errors, please create a pull request with the fix, or at least open an issue.

Adding a new country
--------------------

[](#adding-a-new-country)

1. Create a new class in the `Countries` directory. It should extend the `Country` class.
2. Add a test for the new country in the `tests` directory.
3. Run the tests so a snapshot gets created.
4. Verify the result in the newly created snapshot is correct.
5. If the country has multiple languages, add a file in the `lang/` directory.

In case your country has specific rules for calculating holidays, for example region specific holidays, you can pass this to the constructor of your country class.

```
$holidays = Holidays::for(Germany::make('DE-BW'))->get();
```

The value, `DE-BW`, will be passed to the region parameter of the constructor of a country.

```
class Germany extends Country
{
    protected function __construct(
        protected ?string $region = null,
    ) {
    }

    protected function allHolidays(int $year): array
    {
        // Here you can use $this->region (or other variables) to calculate holidays
    }
```

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for more details.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Niels Vanpachtenbeke](https://github.com/Nielsvanpach)
- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance85

Actively maintained with recent releases

Popularity61

Solid adoption and visibility

Community33

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 57.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~29 days

Total

39

Last Release

81d ago

Major Versions

0.0.2 → 1.0.02024-01-17

1.24.0 → v2.x-dev2026-02-26

PHP version history (2 changes)0.0.1PHP ^8.1

v2.x-devPHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (322 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (79 commits)")[![lowv-developer](https://avatars.githubusercontent.com/u/17094957?v=4)](https://github.com/lowv-developer "lowv-developer (17 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (15 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (14 commits)")[![patressz](https://avatars.githubusercontent.com/u/81393875?v=4)](https://github.com/patressz "patressz (12 commits)")[![levrailoup](https://avatars.githubusercontent.com/u/28599391?v=4)](https://github.com/levrailoup "levrailoup (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (10 commits)")[![lamelas](https://avatars.githubusercontent.com/u/210068?v=4)](https://github.com/lamelas "lamelas (8 commits)")[![Chris53897](https://avatars.githubusercontent.com/u/7104259?v=4)](https://github.com/Chris53897 "Chris53897 (6 commits)")[![thinkstylestudio](https://avatars.githubusercontent.com/u/322368?v=4)](https://github.com/thinkstylestudio "thinkstylestudio (6 commits)")[![arnebr](https://avatars.githubusercontent.com/u/1068416?v=4)](https://github.com/arnebr "arnebr (6 commits)")[![davsaniuv](https://avatars.githubusercontent.com/u/58817543?v=4)](https://github.com/davsaniuv "davsaniuv (5 commits)")[![mauricius](https://avatars.githubusercontent.com/u/7000852?v=4)](https://github.com/mauricius "mauricius (5 commits)")[![xHeaven](https://avatars.githubusercontent.com/u/14284867?v=4)](https://github.com/xHeaven "xHeaven (4 commits)")[![Kenny1291](https://avatars.githubusercontent.com/u/53661492?v=4)](https://github.com/Kenny1291 "Kenny1291 (4 commits)")[![amitsamtani](https://avatars.githubusercontent.com/u/107021?v=4)](https://github.com/amitsamtani "amitsamtani (4 commits)")[![calonzolg](https://avatars.githubusercontent.com/u/19369562?v=4)](https://github.com/calonzolg "calonzolg (3 commits)")[![Crawford30](https://avatars.githubusercontent.com/u/30619160?v=4)](https://github.com/Crawford30 "Crawford30 (3 commits)")[![Ayoub-Mabrouk](https://avatars.githubusercontent.com/u/77799760?v=4)](https://github.com/Ayoub-Mabrouk "Ayoub-Mabrouk (3 commits)")

---

Tags

dateholidaysphpspatieholidays

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/spatie-holidays/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-holidays/health.svg)](https://phpackages.com/packages/spatie-holidays)
```

###  Alternatives

[spatie/laravel-analytics

A Laravel package to retrieve Google Analytics data.

3.2k5.7M57](/packages/spatie-laravel-analytics)[spatie/laravel-schedule-monitor

Monitor scheduled tasks in a Laravel app

9815.7M9](/packages/spatie-laravel-schedule-monitor)[spatie/laravel-google-calendar

Manage events on a Google Calendar

1.4k1.5M21](/packages/spatie-laravel-google-calendar)[spatie/ssl-certificate

A class to easily query the properties of an ssl certificate

7414.8M35](/packages/spatie-ssl-certificate)[spatie/laravel-personal-data-export

Create personal data downloads in a Laravel app

550543.8k8](/packages/spatie-laravel-personal-data-export)[spatie/laravel-directory-cleanup

This package will remove the expired files from the given directories.

3061.4M6](/packages/spatie-laravel-directory-cleanup)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
