Laravel Nova custom field for https://github.com/spatie/opening-hours
Laravel Nova custom field for Spatie Opening Hours
You can install the package in to a Laravel app that uses Nova via composer:
composer require sadekd/nova-opening-hours-field
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
The MIT License (MIT). Please see License File for more information.