Results
Calendary returns result objects rather than raw arrays.
The primary result types are:
Each implements the Result contract and supports:
They are also JSON serializable.
Day
A Day represents the resolved state of one calendar date.
$day->date();
$day->weekday();
$day->status();
$day->available();
$day->slots();
$day->availableSlots();
$day->isAvailable('10:00');
Day Statuses
| Status | Meaning |
|---|---|
open |
At least one generated slot is available |
closed |
No availability applies to the date |
full |
Availability exists but all generated slots are busy |
day_off |
The date is explicitly marked as a day off |
holiday |
The date is explicitly marked as a holiday |
Constants are available:
Slot
A Slot represents one generated time period.
Slot statuses are:
available
busy
Constants:
start() and end() return DateTimeImmutable.
Range
A Range contains resolved days for a requested date range.
The requested range boundaries remain unchanged when filters are used.
For example:
from() and to() still represent the requested October range, while
days() contains only matching days.
Serialization
Or:
You may also use normal JSON serialization: