https://github.com/sadekd/nova-opening-hours-field
Laravel Nova custom field for https://github.com/spatie/opening-hours
https://github.com/sadekd/nova-opening-hours-field
field laravel nova opening-hours
Last synced: 5 months ago
JSON representation
Laravel Nova custom field for https://github.com/spatie/opening-hours
- Host: GitHub
- URL: https://github.com/sadekd/nova-opening-hours-field
- Owner: sadekd
- License: mit
- Created: 2019-02-27T06:56:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-20T10:20:36.000Z (over 1 year ago)
- Last Synced: 2025-11-27T16:30:07.818Z (7 months ago)
- Topics: field, laravel, nova, opening-hours
- Language: Vue
- Homepage:
- Size: 737 KB
- Stars: 38
- Watchers: 5
- Forks: 32
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Nova Opening Hours Field
[](https://packagist.org/packages/sadekd/nova-opening-hours-field)
[](https://packagist.org/packages/sadekd/nova-opening-hours-field)
[](https://packagist.org/packages/sadekd/nova-opening-hours-field)
[](https://packagist.org/packages/sadekd/nova-opening-hours-field)
[Laravel](https://laravel.com) [Nova](https://nova.laravel.com) custom field for [Spatie Opening Hours](https://github.com/spatie/opening-hours)
### Index

### Form

### Detail

## Installation
You can install the package in to a [Laravel](https://laravel.com) app that uses [Nova](https://nova.laravel.com) via composer:
```bash
composer require sadekd/nova-opening-hours-field
```
## Usage
Laravel Migration
```php
$table->json('opening_hours'); // can be ->nullable()
```
Laravel Model
```php
protected $casts = [
'opening_hours' => 'array',
];
```
Nova Resource
```php
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](LICENSE.md) for more information.