Skip to content
yarunoka.dev

Installation

View Markdown

Terminal window
composer require yarunoka/core

That is the whole installation. The package registers nothing, publishes no configuration, and has no bootstrapping step — every entry point is a class you construct yourself.

A document may name a resolver instead of listing dates:

{"calendar": {"holidays": "yasumi-Japan"}}

A name of the form yasumi-{Provider} is resolved by yasumi when that library is installed, with no resolver of your own to write:

Terminal window
composer require azuyalabs/yasumi

{Provider} is a yasumi provider name (Japan, USA, …). Without the library installed, such a name is simply an unregistered resolver, and a document using it fails validation — nothing resolves silently to an empty list.

Any other name is yours to bind. See Supplying dates at runtime.

use Yarunoka\YrnkParser;
$document = (new YrnkParser())->parse('{
"version": "1.0",
"timezone": "Asia/Tokyo",
"schedules": [{"days": [25], "times": ["10:00"]}]
}');
$document->timezone->getName(); // "Asia/Tokyo"
count($document->schedules); // 1

Integration with Laravel is the job of the separate yarunoka/laravel package rather than of this one. Its own documentation covers installing and configuring it.