hirehq/laravel-bank-holidays 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hirehq/laravel-bank-holidays

Composer 安装命令:

composer require hirehq/laravel-bank-holidays

包简介

UK bank holiday and working day Carbon macros backed by the GOV.UK bank holiday feed.

README 文档

README

Tests

hirehq/laravel-bank-holidays adds UK-aware Carbon macros for working day calculations in Laravel applications, using the official GOV.UK bank holiday feed.

Features

  • Carbon macros for moving forward and backward by working day
  • Predicate helpers for working days and bank holidays
  • GOV.UK bank holiday feed integration with long-lived caching
  • Support for england-and-wales, scotland, and northern-ireland
  • Laravel package auto-discovery with publishable configuration

Installation

composer require hirehq/laravel-bank-holidays

Publish Configuration

php artisan vendor:publish --tag=bank-holidays-config

This publishes config/bank_holidays.php to your application.

Configuration

return [
    'division' => 'england-and-wales',
    'cache_days' => 31,
    'timezone' => null,
];
  • division: england-and-wales, scotland, or northern-ireland
  • cache_days: feed cache lifetime in days
  • timezone: optional override; falls back to app.timezone_display, then app.timezone

The package always uses the official GOV.UK bank holiday endpoint over HTTPS and validates the response structure before caching it.

Compatibility

Package Version Laravel PHP
current 11.x, 12.x, 13.x 8.2, 8.3, 8.4, 8.5

Usage

use Carbon\CarbonImmutable;

$date = CarbonImmutable::parse('2025-05-23');

$next = $date->addWorkingDay();
$previous = $date->subWorkingDay();

$isWorkingDay = $date->isWorkingDay();
$isBankHoliday = $date->isBankHoliday();

The package evaluates weekends and the configured UK bank holiday division when resolving working days.

Testing

From the package directory:

composer install
composer test
composer refactor

Contributing

Please review CONTRIBUTING.md before opening a pull request.

Security

Please report vulnerabilities according to SECURITY.md. Sensitive security reports can be sent to security@hirehq.co.uk.

统计信息

  • 总下载量: 227
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固