Skip to main content

Add the trait to your model

HasBusinessHours provides a morphOne relationship to BusinessHours, an accessor to get an OpeningHours instance, and helper methods:
Every method from Spatie’s Opening Hours is also available for querying and formatting.

Form field

Any form layout can wrap it:

Exceptions

->allowExceptions() adds a “Set up” button that opens a modal for holidays, special hours, and closures. They’re saved Spatie-style in an exceptions column:

Table column

Infolist entry

Any infolist layout can wrap it: