chengkangzai/laravel-office-holidays

A Laravel Package that list out holiday that Scraped from https://www.officeholidays.com/countries

Fund package maintenance!
CCK

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:HTML

v0.0.1 2024-05-12 14:36 UTC

This package is auto-updated.

Last update: 2024-06-21 01:22:24 UTC


README

A Laravel Package that list out office's Holiday that Scraped from https://www.officeholidays.com/countries

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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 and year

$laravelOfficeHolidays = new CCK\LaravelOfficeHolidays();
app(LaravelOfficeHolidays::class)->getAllHolidays('malaysia', 2024)

Get All Holidays for a specific country and 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.