Spatie released a Holiday package.

Published in Community content on Jan 28, 2024

Last week Spatie released a mini package that allows you to calculate the holidays for a specific country / year or even a target date.

They called upon the community to assist in gathering all holidays for all countries that still needed to be added to the package.
Also I did my part by contributing 😁

Using the package

As usual, using a spatie package is super clear and easy.
Here is small example for this package.

use Spatie\Holidays\Holiday;

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

// returns a boolean 
Holidays::for('be')->isHoliday('2024-01-01'); // true

👉 The spatie/holidays package on GitHub

👉 Read the original blog post about this package by Freek.

#php, #github, #spatie, #package