p-potsikas/laravel-hellenic-holidays
Composer 安装命令:
composer require p-potsikas/laravel-hellenic-holidays
包简介
Laravel package for Greek public holidays and observances.
README 文档
README
██╗ ██╗███████╗██╗ ██╗ ███████╗███╗ ██╗██╗ ██████╗
██║ ██║██╔════╝██║ ██║ ██╔════╝████╗ ██║██║██╔════╝
███████║█████╗ ██║ ██║ █████╗ ██╔██╗ ██║██║██║
██╔══██║██╔══╝ ██║ ██║ ██╔══╝ ██║╚██╗██║██║██║
██║ ██║███████╗███████╗███████╗███████╗██║ ╚████║██║╚██████╗
╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═════╝
██╗ ██╗ ██████╗ ██╗ ██╗██████╗ █████╗ ██╗ ██╗███████╗
██║ ██║██╔═══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝██╔════╝
███████║██║ ██║██║ ██║██║ ██║███████║ ╚████╔╝ ███████╗
██╔══██║██║ ██║██║ ██║██║ ██║██╔══██║ ╚██╔╝ ╚════██║
██║ ██║╚██████╔╝███████╗██║██████╔╝██║ ██║ ██║ ███████║
╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝
Wake up, Laravel... The Greek holidays have been calculated. Follow the Orthodox Easter offset.
Laravel package for Greek public holidays and observances, implemented in pure PHP.
The package supports Laravel 10, 11 and 12, and provides a service, facade and helper for common holiday and working-day checks.
Installation
Install from Packagist:
composer require p-potsikas/laravel-hellenic-holidays
If the package has not been published to Packagist yet, install directly from GitHub:
composer config repositories.laravel-hellenic-holidays vcs https://github.com/p-potsikas/laravel-hellenic-holidays composer require p-potsikas/laravel-hellenic-holidays:dev-main
Publish the configuration file:
php artisan vendor:publish --tag=hellenic-holidays-config
Laravel auto-discovery registers the service provider automatically.
Usage
use HellenicHolidays; $holidays = HellenicHolidays::getHolidays(2026); $result = HellenicHolidays::isHoliday('2026-12-25'); $next = HellenicHolidays::getNextHoliday(); $isWorkingDay = HellenicHolidays::isWorkingDay('2026-06-19');
You can also import the facade class directly:
use Potsikas\LaravelHellenicHolidays\Facades\HellenicHolidays;
Helper:
$holidays = hellenic_holidays()->getHolidays(2026);
The facade exposes:
HellenicHolidays::getHolidays(2026); HellenicHolidays::isHoliday('2026-12-25'); HellenicHolidays::getNextHoliday('2026-12-24'); HellenicHolidays::getHolidaysByType(2026, 'national'); HellenicHolidays::isWorkingDay('2026-06-19'); HellenicHolidays::orthodoxEaster(2026);
Controller Example
<?php namespace App\Http\Controllers; use Potsikas\LaravelHellenicHolidays\Facades\HellenicHolidays; final class HolidayController { public function index(int $year): array { return array_map( fn ($holiday) => $holiday->toArray(), HellenicHolidays::getHolidays($year) ); } public function check(string $date): array { return HellenicHolidays::isHoliday($date)->toArray(); } }
Included Holidays
Fixed holidays:
- 01-01 Πρωτοχρονιά / New Year's Day
- 06-01 Θεοφάνεια / Epiphany
- 25-03 Ευαγγελισμός της Θεοτόκου - Εθνική Εορτή / Greek Independence Day
- 01-05 Εργατική Πρωτομαγιά / Labour Day
- 15-08 Κοίμηση της Θεοτόκου / Dormition of the Mother of God
- 28-10 Επέτειος του Όχι / Ohi Day
- 25-12 Χριστούγεννα / Christmas Day
- 26-12 Σύναξη της Θεοτόκου / Synaxis of the Mother of God
Movable holidays based on Orthodox Easter:
- Καθαρά Δευτέρα, Easter -48
- Μεγάλη Παρασκευή, Easter -2
- Μεγάλο Σάββατο, Easter -1
- Κυριακή του Πάσχα, Easter
- Δευτέρα του Πάσχα, Easter +1
- Αγίου Πνεύματος, Easter +50
Αγίου Πνεύματος is included as an optional holiday. Enable optional holidays with include_optional_holidays.
Configuration
return [ 'locale' => 'el', 'include_saturdays_as_non_working_day' => true, 'include_sundays_as_non_working_day' => true, 'include_optional_holidays' => false, 'custom_holidays' => [ '2026-12-31' => [ 'name_el' => 'Ειδική Αργία', 'name_en' => 'Special Holiday', 'type' => 'custom', 'is_public_holiday' => true, ], ], 'overridden_holidays' => [], 'moved_holidays' => [ 'labour_day' => [ 2026 => '2026-05-04', ], ], ];
For payroll, legal or HR use, verify exceptional transferred holidays and year-specific ministerial decisions before relying on generated results.
Data Objects
Holiday contains:
date:Carbon\CarbonImmutablenameEl: Greek namenameEn: English nametype:HolidayTypeisPublicHoliday: public holiday flagkey: stable identifier
HolidayResult contains:
isHoliday: booleanholiday:Holiday|null
Both objects include toArray() methods.
Attribution
This package is an original PHP/Laravel implementation. The idea and public API shape are inspired by the MIT-licensed eliac7/hellenic-holidays JavaScript package.
No JavaScript source code from that project is included.
License
The MIT License (MIT). See LICENSE.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-20