PHPackages                             san103/php-holiday-api - 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. [API Development](/categories/api)
4. /
5. san103/php-holiday-api

ActiveLibrary[API Development](/categories/api)

san103/php-holiday-api
======================

An holiday API for php

v1.3.9(2y ago)4345MITPHP

Since Dec 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/San103/HolidayDates-Package)[ Packagist](https://packagist.org/packages/san103/php-holiday-api)[ RSS](/packages/san103-php-holiday-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (17)Used By (0)

Php-Holiday-Package
===================

[](#php-holiday-package)

A Dynamic Holiday package for Php/ Laravel based on `Google Calendar API`

```
composer require san103/php-holiday-api

```

Prerequisites
=============

[](#prerequisites)

- PHP 8.0 or higher
- Composer
- Guzzlehttp/guzzle"

Installation
============

[](#installation)

```
composer install

```

```
composer require guzzlehttp/guzzle:^7.0

```

Basic Usage
===========

[](#basic-usage)

 Define package
----------------

[](#-define-package-)

```
namespace App/YourApp

use San103\Phpholidayapi\HolidayClient;

```

```
$holiday = new HolidayClient();

```

- (Optional) Set your Country Code e.g uk for United Kindom, us for United State `default sets to Philippines`

```
countryCode('uk')

```

- (Optional) Set Year you want to display the holiday dates , `default is set to current year which is 2023`

```
year('2022')

```

Important

> The `result()` must define in last chain.

```
result();

```

- Example usage in php

```
require 'vendor/autoload.php';
use San103\Phpholidayapi\HolidayClient;

public function index(){

        $api = new HolidayClient();
        return $api
                    ->countryCode('uk')
                    ->year('2023')
                    ->result();

    }

```

- Example usage in Laravel 10

```
use San103\Phpholidayapi\HolidayClientLaravel;

public function index(){

        $api = new HolidayClientLaravel();
        return $api
                    ->countryCode('uk')
                    ->year('2023')
                    ->result();

    }

```

### Special Feature for Laravel 10

[](#special-feature-for-laravel-10)

- Install Cache
- use the HolidayClientLaravel source

```
 return Cache::remember(date('Y'), now()->addMonth(), function () use ($http) {

```

change the `now()->addMonth()` to set expiration of the cache

Note

You may also provide your own Api key from [Google API](https://developers.google.com/calendar/api/guides/overview). just enable the Calendar Api and generate key

```
apiKey('your-api-key')

```

Output
------

[](#output)

```
"
{
    "21":{
        "id":"20230101_i536",
        "title":"New Year\'s Day",
        "description":"Public holiday",
        "date":{"date":"2023-01-01"}},

    "23":{
        "id":"20230225_qh5n",
        "title":"People Power Anniversary",
        "description":"Public holiday",
        "date":{"date":"2023-02-25"}},

    "24":{
        "id":"20230406_hvi",
        "title":"Maundy Thursday",
        "description":"Public holiday",
        "date":{"date":"2023-04-06"}},

    "25":{
        "id":"20230407_fv",
        "title":"Good Friday",
        "description":"Public holiday",
        "date":{"date":"2023-04-07"}},

    "26":{
        "id":"20230408_6v",
        "title":"Black Saturday",
        "description":"Public holiday",
        "date":{"date":"2023-04-08"}},

    "28":{
        "id":"20230501_on",
        "title":"Labor Day",
        "description":"Public holiday",
        "date":{"date":"2023-05-01"}},

    "29":{
        "id":"20230612_kq",
        "title":"Independence Day",
        "description":"Public holiday",
        "date":{"date":"2023-06-12"}},

    "30":{
        "id":"20230821_p0c",
        "title":"Ninoy Aquino Day",
        "description":"Public holiday",
        "date":{"date":"2023-08-21"}},
    ...
"

```

Important

If you make this useful give us a star! Thank you and GodBless

License
-------

[](#license)

The package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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 ~10 days

Recently: every ~30 days

Total

13

Last Release

774d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75378566c7963cdbf6f202cff118882749e48572f756af2f10245828ebe4a327?d=identicon)[San103](/maintainers/San103)

---

Top Contributors

[![San103](https://avatars.githubusercontent.com/u/106059541?v=4)](https://github.com/San103 "San103 (40 commits)")

---

Tags

apicomposer-librarygoogle-calendarholiday-apilaravelpackagephp

### Embed Badge

![Health badge](/badges/san103-php-holiday-api/health.svg)

```
[![Health](https://phpackages.com/badges/san103-php-holiday-api/health.svg)](https://phpackages.com/packages/san103-php-holiday-api)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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