PHP code example of p-potsikas / laravel-hellenic-holidays
1. Go to this page and download the library: Download p-potsikas/laravel-hellenic-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/ */
p-potsikas / laravel-hellenic-holidays example snippets
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();
}
}