NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages

All exceptions extend the abstract OpeningHoursException (a RuntimeException), so you can catch everything in one place. Messages are developer-facing English; user-facing text travels as translated violation messages:

use RoundlyConsulting\OpeningHours\Exceptions\OpeningHoursException;
use RoundlyConsulting\OpeningHours\Exceptions\QueryRangeTooLargeException;

try {
    $days = $hours->forPeriod('2026-01-01', '2027-12-31');
} catch (QueryRangeTooLargeException $e) {
    // $e->requestedDays, $e->maxDays — split the range or raise max_query_days
} catch (OpeningHoursException $e) {
    // every package exception extends this RuntimeException
}
ExceptionThrown when
InvalidOpeningHoursExceptionA definition fails validation; violations() returns every problem.
InvalidTimeException / InvalidDateExceptionA malformed time, range, date or month-day.
InvalidTimezoneExceptionA timezone that is not an IANA name.
QueryRangeTooLargeExceptionA span beyond max_query_days (requestedDays, maxDays).
StaleOpeningHoursExceptionA concurrent write moved the revision (expected, actual).
CalendarNotFoundExceptionAn exception write targets a calendar the owner doesn’t have (never synced, or soft-deleted) — sync() it first.
InvalidBusyPeriodException / TooManyBusyPeriodsExceptionAn empty or inverted busy period, an invalid weight or column, or more periods than limits.busy_periods.
InvalidSlotQueryExceptionA slot query without a duration or with an out-of-range setting.
InvalidOwnerExceptionThe owner is not persisted, doesn’t implement OpeningHoursOwner, or can’t be found.
OutsideMaterializedHorizonExceptionAn SQL scope instant outside the materialized horizon.

Invalid config values surface as the toolkit’s InvalidConfigurationException.

Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

More ways to support, including crypto

By donating, you agree to our donation terms.

Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.