innonazarene/ph-holiday-calendar
Composer 安装命令:
composer require innonazarene/ph-holiday-calendar
包简介
Laravel package that returns Philippine public holidays (from the Official Gazette) for your calendar.
README 文档
README
A Laravel package that returns Philippine public holidays (from the Official Gazette) in a single API response.
What it returns
{
"ph_holidays": [
{
"date": "2026-04-17",
"localName": "Biyernes Santo",
"name": "Good Friday",
"countryCode": "PH",
"fixed": false,
"global": true,
"types": ["Public"]
}
],
"activities_list": []
}
activities_listis an array provided manually by the developer. You handle your own database queries and inject the results here!
Installation
composer require innonazarene/ph-holiday-calendar
Auto-discovery registers the service provider and PhHolidayCalendar facade.
Publish config
php artisan vendor:publish --tag=ph-holiday-calendar-config
Usage
Facade
use PhHolidayCalendar\Facades\PhHolidayCalendar; // 1. Manually query your own database, format it however you want $myActivities = [ [ 'id' => 1, 'title' => 'Personal Vacation', 'date' => '2026-05-10', 'type' => 'personal' ] ]; // 2. Combined holidays + your manual activities for a month $data = PhHolidayCalendar::forMonth(year: 2026, month: 5, activitiesList: $myActivities); // [ // 'ph_holidays' => [ ... ], // 'activities_list' => [ ... ] // ] // Combined for a full year $data = PhHolidayCalendar::forYear(year: 2026, activitiesList: $myActivities); // Holidays only $holidays = PhHolidayCalendar::holidays(2026); // Check a specific date PhHolidayCalendar::isHoliday('2026-12-25'); // true PhHolidayCalendar::holidayOn('2026-12-25'); // Holiday DTO or null
Dependency injection
use PhHolidayCalendar\PhHolidayCalendar; class MyService { public function __construct(private PhHolidayCalendar $calendar) {} public function getCalendar(): array { // Inject your custom activities here! $myActivities = []; return $this->calendar->forMonth(2026, 4, $myActivities); } }
API Routes
Add to routes/api.php:
use App\Http\Controllers\Api\CalendarController; Route::prefix('calendar')->group(function () { Route::get('/', [CalendarController::class, 'index']); // holidays + activities Route::get('/holidays', [CalendarController::class, 'holidays']); // holidays only Route::get('/check', [CalendarController::class, 'check']); // is date a holiday? });
See examples/CalendarController.php for the full controller.
Holiday types
types value |
Meaning | Pay rule |
|---|---|---|
"Public" |
Regular Holiday | 100% pay even if absent |
"Optional" |
Special Non-Working Day | No work, no pay |
"WorkDay" |
Special Working Day | Normal working day |
License
MIT
innonazarene/ph-holiday-calendar 适用场景与选型建议
innonazarene/ph-holiday-calendar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「calendar」 「laravel」 「philippines」 「holidays」 「official-gazette」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 innonazarene/ph-holiday-calendar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 innonazarene/ph-holiday-calendar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 innonazarene/ph-holiday-calendar 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Philippines region, province, cities/municipalities and barangays Laravel migration and table seeder.
A modern PHP library for generating iCalendar v2.0 events
A powerful event calendar Tool for Laravel's Nova 5.
Check for holidays - localeaware
This TYPO3 distribution provides a sample website using bootstrap and the extensions pizpalue and container_elements. The distribution tailors Swiss market featuring German as default language and additional translations to French, English and Finnish.
Alfabank REST API integration
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 36
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-26