sadekd / nova-opening-hours-field
Laravel Nova custom field for Spatie Opening Hours
Installs: 235 929
Dependents: 0
Suggesters: 0
Security: 0
Stars: 39
Watchers: 5
Forks: 30
Open Issues: 8
Language:Vue
Requires
- php: ^8.1
- laravel/nova: ^5.0
- spatie/opening-hours: ^2.0|^3.0
Requires (Dev)
- laravel/nova-devtool: ^1.1.4
README
Laravel Nova custom field for Spatie Opening Hours
Index
Form
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.