1. Go to this page and download the library: Download artarts36/laravel-holiday 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/ */
artarts36 / laravel-holiday example snippets
$client = new \GuzzleHttp\Client([
'base_uri' => 'https://isdayoff.ru/',
]);
$isDayOff = new \ArtARTs36\LaravelHoliday\Determiners\IsDayOff($client);
var_dump($isDayOff->determine(\Carbon\Carbon::parse('2020-11-04'))); // string(7) "weekend"
$client = new \GuzzleHttp\Client([
'base_uri' => 'https://isdayoff.ru/',
]);
$isDayOff = new \ArtARTs36\LaravelHoliday\Determiners\IsDayOff($client);
var_dump($isDayOff->determinePeriod(\Carbon\Carbon::parse('2020-11-04'), \Carbon\Carbon::parse('2020-12-15')));
$client = new \GuzzleHttp\Client([
'base_uri' => 'https://isdayoff.ru/',
]);
$isDayOff = new \ArtARTs36\LaravelHoliday\Determiners\IsDayOff($client);
var_dump($isDayOff->determineYear(20));