PHP code example of tomhatzer / nova-business-hours
1. Go to this page and download the library: Download tomhatzer/nova-business-hours library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// Add the use at the top of each file where you want to use the OpeningHours class:
use Spatie\OpeningHours\OpeningHours;
// Get your model instance
$model = Model::find(1);
// Fill the OpeningHours class with your business hours
$openingHours = OpeningHours::create($model->business_hours);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.