LaravelPackages.net
Acme Inc.
Toggle sidebar
sadekd/nova-opening-hours-field

Laravel Nova custom field for Spatie Opening Hours

327.328
38
v4.0.0
About sadekd/nova-opening-hours-field

sadekd/nova-opening-hours-field is a Laravel package for laravel nova custom field for spatie opening hours. It currently has 38 GitHub stars and 327.328 downloads on Packagist (latest version v4.0.0). Install it with composer require sadekd/nova-opening-hours-field. Discover more Laravel packages by sadekd or browse all Laravel packages to compare alternatives.

Last updated

Nova Opening Hours Field

Latest Stable Version Total Downloads License PHP Version Require

Laravel Nova custom field for Spatie Opening Hours

Index

Screenshot Index

Form

Screenshot Form

Detail

Screenshot Detail

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require sadekd/nova-opening-hours-field

Usage

Laravel Migration

$table->json('opening_hours');  // can be ->nullable()

Laravel Model

protected $casts = [
    'opening_hours' => 'array',
];

Nova Resource

NovaOpeningHoursField::make(__('Opening Hours'), 'opening_hours'),
// ->allowExceptions(FALSE)    // TRUE by default
// ->allowOverflowMidnight(TRUE)  // FALSE by default
// ->useTextInputs(TRUE)  // FALSE by default

Known issues

  • Lazy validation on time field - losing focus when live(help needed)
  • Editing date in exceptions causes row jumping - key from date(help needed)
  • Browser time input does not support 24:00
  • Browser date input does not support recurring format

TODO

  • [x] Explode interval input => time fields
  • [x] Validation
  • [x] Localization
  • [x] Exceptions
  • [ ] Tests

License

The MIT License (MIT). Please see License File for more information.

Star History Chart