PHP code example of chengkangzai / laravel-office-holidays

1. Go to this page and download the library: Download chengkangzai/laravel-office-holidays library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

chengkangzai / laravel-office-holidays example snippets


return [
    'cache' => [
        'driver' => 'file',
        'duration' => 60 * 60 * 24 * 7 // 1 week
    ]
];

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

$laravelOfficeHolidays = new CCK\LaravelOfficeHolidays();
app(LaravelOfficeHolidays::class)->getHolidaysByState('malaysia', 2024, 'johor')
bash
php artisan vendor:publish --tag="laravel-office-holidays-config"