- What does sadekd/nova-opening-hours-field do?
- It is a Laravel Nova custom form field for managing weekly opening hours on a model. Editors can define per-day time ranges and closed days, and the field persists the schedule as structured JSON. It is designed for admin data capture in resources such as restaurants, shops, branches, or clinics.
- How do I install sadekd/nova-opening-hours-field?
- Install it with Composer using composer require sadekd/nova-opening-hours-field, then publish Nova assets with php artisan nova:publish and clear caches. After publishing, add the field to the relevant Nova resource and smoke-test the editor with a real record. Because it is a Nova field, it is coupled to Nova's asset pipeline and major version.
- Is sadekd/nova-opening-hours-field compatible with Laravel Nova 5?
- Yes. Version 4.0.0 is a compatibility-only major whose sole change is Laravel Nova 5 support. Use the ^4.0 line when your admin layer is on Nova 5. Check the package's composer.json for exact Nova, Laravel, and PHP constraints before upgrading.
- Can I still use this package on Laravel Nova 4?
- Nova 4 users should stay on the 3.0.7 line because v4.0.0 drops Nova 4 support. That makes 3.0.7 a maintenance dead end once future fixes land only on 5.x. Pin 3.0.7 explicitly if you need a rollback while still on Nova 4.
- How do I add the opening hours field to a Laravel Nova resource?
- Add the field to a Nova resource's fields method like any other Nova field, binding it to the model attribute that stores opening hours. The field provides the weekly schedule editor in the Nova UI, and the resource handles normal create and update flows. Confirm the field's namespace and options against the installed version before wiring it in.
- What format does the package use to store opening hours?
- The package stores the weekly schedule as structured JSON in a model column. The JSON represents multiple time ranges per day, closed days, and full-day availability depending on what the editor captures. Release notes for v4.0.0 do not document a schema change, but verify a sample stored record after any major upgrade.
- Can I set multiple opening time ranges per day and mark days as closed?
- Yes. The field is designed for weekly opening hours with multiple time ranges per day and the ability to mark days as closed. It also supports full-day availability as part of the schedule data. This makes it suitable for businesses with lunch breaks, split shifts, or varying daily hours.
- Does this package tell me whether a business is open now?
- No. This package captures opening hours; it does not evaluate them. There is no built-in open or closed logic, timezone conversion, holiday override handling, or overnight-span rule engine. If you need Open now behavior, build that separately, likely by layering spatie/opening-hours.
- Does it support timezones, holiday overrides, or overnight opening hours?
- Not as part of the field. Timezone conversion, holiday overrides, and overnight opening rules are not included and must be handled in your application logic or a separate scheduling layer. The field's scope is structured data capture for weekly hours. Treat it as an editor, not a scheduling engine.
- Is sadekd/nova-opening-hours-field maintained, and what are the alternatives?
- It is a small, single-maintainer package with a low star count and no SLA, which is acceptable for a contained admin widget but not a critical dependency. v4.0.0 is a compatibility-only major for Nova 5, so plan it as a lockstep rider on a Nova upgrade rather than an independent upgrade. For availability computation, use spatie/opening-hours or custom logic; for non-Nova admin stacks, use the equivalent tooling for that stack.