Laravel Nova icon Nova Packages

Readme

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

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

License

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

Reviews

Rated 5 stars out of 5

By Roeland Reyniers on July 10, 2020

Would love to see the planned improvements, but works great!

Back to Top
Added 4 years ago
Last updated 5 Months Ago
Version v4.0.0
Nova Version ^5.0
Composer
sadekd/nova-opening-hours-field
GitHub stars 39
Packagist downloads 255,728

Favorites

15 users favorited

Rating

5.00
(out of 5)
★★★★★
★★★★
★★★
★★
7 ratings

Tags

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas