PHPackages                             afiqiqmal/country-holiday - 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. afiqiqmal/country-holiday

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

afiqiqmal/country-holiday
=========================

A PHP package to retrieve holiday dates for various countries.

1.0.6(1y ago)1975↓80.1%[1 PRs](https://github.com/afiqiqmal/country-holiday/pulls)MITPHPPHP &gt;=8.2

Since Nov 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/afiqiqmal/country-holiday)[ Packagist](https://packagist.org/packages/afiqiqmal/country-holiday)[ RSS](/packages/afiqiqmal-country-holiday/feed)WikiDiscussions main Synced yesterday

READMEChangelog (7)Dependencies (5)Versions (9)Used By (0)

National Holidays ✈️
====================

[](#national-holidays-airplane)

Parsing National Public Holidays

[![Packagist](https://camo.githubusercontent.com/7dd112c48bb36cb36787b7c3b025f0f6076c923c30c5c690ac24f6dc7abc2081/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6166697169716d616c2f636f756e7472792d686f6c696461792e737667)](https://packagist.org/packages/afiqiqmal/country-holiday)[![Packagist](https://camo.githubusercontent.com/ddaa24181d9067298f4bdea0a0ee68f6ea9369c89595563fdfbd2c8fe2296731/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6166697169716d616c2f636f756e7472792d686f6c696461792e737667)](https://packagist.org/packages/afiqiqmal/country-holiday)[![Donate](https://camo.githubusercontent.com/604e3db9c8751116b3f765aad0353ec7ded655bbe8aaacbc38d8c4a6b784b3ed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d677265656e2e737667)](https://www.paypal.com/paypalme/mhi9388?locale.x=en_US)

[![](https://camo.githubusercontent.com/f23f684fd44a36fe36ff157a642fcfa1562f219cf23d2ec1e33821d58dcdd5dd/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f436f756e747279253230486f6c696461792e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6166697169716d616c253246436f756e747279486f6c69646179267061747465726e3d746963546163546f65267374796c653d7374796c655f31266465736372697074696f6e3d50617273696e672b4e6174696f6e616c2b5075626c69632b486f6c69646179266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d666c6167)](https://camo.githubusercontent.com/f23f684fd44a36fe36ff157a642fcfa1562f219cf23d2ec1e33821d58dcdd5dd/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f436f756e747279253230486f6c696461792e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6166697169716d616c253246436f756e747279486f6c69646179267061747465726e3d746963546163546f65267374796c653d7374796c655f31266465736372697074696f6e3d50617273696e672b4e6174696f6e616c2b5075626c69632b486f6c69646179266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d666c6167)

### How to Use

[](#how-to-use)

Declare

```
$holiday = new Holiday;
app(Holiday::class); // if bound with laravel refer here - https://laravel.com/docs/11.x/container#contextual-binding
```

Holidays in current year

```
Holiday::for('countryName')->fromAllState()->get();
Holiday::make()->fromAllState()->get();
```

Holidays in specific years

```
Holiday::for('countryName')->fromAllStates(2017)->get();
Holiday::for('countryName')->fromAllStates([2017, 2019])->get();
Holiday::for('countryName')->fromAllStates()->ofYear(2017)->get();
Holiday::make()->fromAllStates()->ofYear(2017)->get();
```

Holidays by region

```
Holiday::for('malaysia')->fromState("Selangor")->get();
Holiday::for('malaysia')->fromState(["Selangor","Malacca"])->get();
```

Holidays by region and year

```
Holiday::for('malaysia')->fromState("Selangor","2017")->get();
Holiday::for('malaysia')->fromState("Selangor", [2017, 2019])->get();
Holiday::for('malaysia')->fromState(["Selangor","Malacca"], [2017, 2019])->get();
Holiday::for('malaysia')->fromState(["Selangor","Malacca"])->ofYear([2017, 2019])->get();
```

Group and filter results

```
$holiday = new Holiday;
Holiday::for('malaysia')->fromAllStates()->groupByMonth()->get();
Holiday::for('malaysia')->fromAllStates()->filterByMonth(1)->get();  //date('F')
```

### Requirements

[](#requirements)

PHP 8.2 and above

### To install

[](#to-install)

run

`composer require afiqiqmal/country-holiday`

### Sample

[](#sample)

```
{
   "status":true,
   "data":[
      {
         "regional":"Selangor",
         "collection":[
            {
               "year":2019,
               "data":[
                  {
                     "day":"Tuesday",
                     "date":"2019-01-01",
                     "date_formatted":"01 January 2019",
                     "month":"January",
                     "name":"New Year's Day",
                     "description":"Regional Holiday",
                     "is_holiday":true,
                     "type":"Regional Holiday",
                     "type_id":4
                  },
                  {
                     "day":"Monday",
                     "date":"2019-01-21",
                     "date_formatted":"21 January 2019",
                     "month":"January",
                     "name":"Thaipusam",
                     "description":"Regional Holiday",
                     "is_holiday":true,
                     "type":"Regional Holiday",
                     "type_id":4
                  }
               ]
            }
         ]
      },
      {
         "regional":"Johor",
         "collection":[
            {
               "year":2019,
               "data":[
                  {
                     "day":"Monday",
                     "date":"2019-01-21",
                     "date_formatted":"21 January 2019",
                     "month":"January",
                     "name":"Thaipusam",
                     "description":"Regional Holiday",
                     "is_holiday":true,
                     "type":"Regional Holiday",
                     "type_id":4
                  }
               ]
            }
         ]
      }
   ],
   "developer":{
      "name":"Hafiq",
      "email":"hafiqiqmal93@gmail.com",
      "github":"https://github.com/afiqiqmal"
   }
}
```

### Source 📅

[](#source-date)

Scraped from -

### MIT Licence

[](#mit-licence)

Copyright © 2017 @afiqiqmal

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

### Donate to the project 🍵

[](#donate-to-the-project-tea)

[![](https://camo.githubusercontent.com/fae49c14c08b15cedc0f829bf690717f2edabe33f88a6c67f6f8f7225702abc6/68747470733a2f2f692e696d6775722e636f6d2f5932677172326a2e706e67)](https://www.paypal.com/paypalme/mhi9388?locale.x=en_US)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance41

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~6 days

Total

7

Last Release

546d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1285084ec2d00e6c1442d03992cd156772da7267efdcbe59ac913c0676a9eb89?d=identicon)[afiqiqmal](/maintainers/afiqiqmal)

---

Top Contributors

[![afiqiqmal](https://avatars.githubusercontent.com/u/9051312?v=4)](https://github.com/afiqiqmal "afiqiqmal (5 commits)")

---

Tags

composercountryholidayslaravelphpcountriesdatescalendarholidayspublic holidays

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/afiqiqmal-country-holiday/health.svg)

```
[![Health](https://phpackages.com/badges/afiqiqmal-country-holiday/health.svg)](https://phpackages.com/packages/afiqiqmal-country-holiday)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[sproutcms/cms

Enterprise content management and framework

242.5k4](/packages/sproutcms-cms)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49617.1k](/packages/blackfire-player)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M342](/packages/drupal-core-dev)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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