- How do I install filament-business-hours in my Laravel Filament panel?
- Install it with composer require laboiteacode/filament-business-hours, then publish and run the migration, which creates a single business_hours table. Register the plugin in your panel provider with FilamentBusinessHoursPlugin::make(). After that you can drop the business hours field into any Filament form schema. The whole setup is typically under a day of work on a supported stack.
- Which PHP, Laravel and Filament versions does filament-business-hours support?
- The package supports PHP 8.2 through 8.5, Laravel 12 and 13, and Filament 4 and 5. Those are the only supported versions, so applications still on Laravel 10 or 11, or on Filament 3, are hard-blocked by Composer. Backporting is not cheap because the editing surface is built on Filament 4 form and schema primitives. Check your composer constraints before evaluating the package.
- How does filament-business-hours store opening hours in the database?
- Everything lives in one table with a single row per business, holding a key, timezone, overflow flag, an hours JSON column and an exceptions JSON column. The hours and exceptions are written exactly in the native spatie/opening-hours definition shape, so there is no export step and no proprietary format. No polymorphic relations or side tables are added to your schema.
- Can I query the stored business hours with spatie/opening-hours without loading the Filament page?
- Yes, and this is the package's most important property: the read path does not depend on the package or its UI. You can build an OpeningHours::create() instance from a raw DB::table() query, a seeder, an import job or a queue worker. The package also exposes BusinessHours::openingHours($key) and toOpeningHoursArray() if you prefer its helpers. The UI is replaceable; the data is not.
- How do I configure the grid step, first day of the week and timezone options?
- The package ships a publishable config file, and the plugin also exposes a fluent API so you can override options per panel without touching the published file. You can set the snap step in minutes, choose the first day of the week (Monday by default) and pick a timezone from all IANA identifiers or a restricted list you provide. Grid colors follow your panel's Filament color palette automatically.
- How do I add exceptional closures or special hours for a specific date?
- Exceptional dates are managed from the same field: add a date, mark it as a closure or give it special hours, and optionally attach a label such as Christmas. A repeat every year toggle handles recurring annual dates without re-entering them. These entries are saved as native spatie exceptions, so they are honoured by opening-hours queries immediately. Duplicate coverage across exceptions is rejected on save.
- How do I handle vacation periods or holiday date ranges?
- Vacation periods are date ranges during which the business is closed, each with an optional label, and they are stored as native spatie date-range exceptions. That means your existing OpeningHours queries treat them as ordinary exceptions with no extra work. Individual vacations are capped at 1100 days, and overlapping entries are rejected to keep the stored definition valid.
- Can filament-business-hours manage opening hours for multiple locations or panels?
- You get a per-panel record key, so different Filament panels can each manage a distinct set of hours, and navigation label, icon, group, sort, cluster and access can all be configured. There is no built-in multi-tenant scoping, so dozens of locations means one plugin instance per panel per record key, which gets awkward at scale. Headless or storefront exposure is your own code, not the package's.
- What happens if two admins edit opening hours at the same time?
- The Save action writes the grid, exceptional dates, vacations and settings as one row, so concurrent edits resolve as last-write-wins. There is no optimistic concurrency check and no audit trail recording who changed what. For regulated or multi-editor environments that is a genuine gap and should be mitigated at the application layer, for example with locking or an approval workflow.
- Is filament-business-hours production ready, and what are the maintenance risks?
- The correctness story is stronger than its download count suggests: the save path instantiates OpeningHours before persisting, ranges are normalized and merged, duplicate coverage is rejected, and payload caps defend against crafted Livewire state. CI is pinned to commit SHAs, and the repository ships a SECURITY.md plus Dependabot with a cooldown, which is disciplined for a package this size. The real risk is the bus factor of one and the Filament version treadmill, so plan for a possible delay after a future Filament major.