chengkangzai / laravel-office-holidays
A Laravel Package that list out holiday that Scraped from https://www.officeholidays.com/countries
Fund package maintenance!
CCK
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:HTML
Requires
- php: >=8.1
- ext-dom: *
- illuminate/contracts: ^10.0||^11.0
- saloonphp/cache-plugin: ^3.0
- saloonphp/saloon: ^3.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
README
This package is a Laravel Package that list out office's Holiday that Scraped from https://www.officeholidays.com/. The underlying package that is used to scrape the data is using Saloon.
Installation
You can install the package via composer:
composer require chengkangzai/laravel-office-holidays
You can publish the config file with:
php artisan vendor:publish --tag="laravel-office-holidays-config"
This is the contents of the published config file:
return [ 'cache' => [ 'driver' => 'file', 'duration' => 60 * 60 * 24 * 7 // 1 week ] ];
Usage
Get All Holidays for a specific country with its year
$laravelOfficeHolidays = new CCK\LaravelOfficeHolidays(); app(LaravelOfficeHolidays::class)->getAllHolidays('malaysia', 2024)
Get All Holidays for a specific state of the country with its year
$laravelOfficeHolidays = new CCK\LaravelOfficeHolidays(); app(LaravelOfficeHolidays::class)->getHolidaysByState('malaysia', 2024, 'johor')
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
Alternatives
MalaysiaHoliday -> This project was inspired by Hafiq, his package MalaysiaHoliday is a great alternative for Malaysian Holidays, this package does not limit the usage for laravel.
Spatie Holidays -> This package is a great alternative for holidays from spatie, it is more robust and does not rely on scraping data from the internet.
License
The MIT License (MIT). Please see License File for more information.