armincms/nova-opening-hours 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

armincms/nova-opening-hours

Composer 安装命令:

composer require armincms/nova-opening-hours

包简介

A Nova wrapper field for the spatie opening hours.

README 文档

README

A Nova field for the Spatie opening hours.

Installation

composer require armincms/nova-opening-hours

Usage

At the first, In the Laravel model should cast the attribute to the Array then In the Nova resources follow the below:

use Armincms\Fields\OpeningHours;

...
OpeningHours::make('Name')
...

Restriction

You can use the restrictTo to restrict the user to enter specific hours, like the below:

OpeningHours::make(__('Opening Hours'), '_sfore_opening_hours_')
            ->restrictTo([ 
              'first restriction' => 'Label',
              'second restriction' => 'Label', 
              ...
            ]) 

This restriction will apply to all weekdays. if you want to restrict some days use the following:

OpeningHours::make(__('Opening Hours'), '_sfore_opening_hours_')
            ->restrictionOnSunday([ 
              'first restriction' => 'Label',
              'second restriction' => 'Label', 
              ...
            ]) 
            ->restrictionOnWednesday([ 
              'first restriction' => 'Label',
              'second restriction' => 'Label', 
              ...
            ]) 

Storing

This package stores the opening hours in the following format:

$openingHours = [
    'sunday' => [
      [
        'data' => 'your data',
        'hours' => 'your hours', // 00:08-10:00
      ],
      [ 
        'data' => 'your second data',
        'hours' => 'your second hours', // 11:00-20:00
      ]
    ],
    
    'friday' => [
      [
        'data' => 'your data',
        'hours' => 'your hours', // 00:08-10:00
      ],
      [ 
        'data' => 'your second data',
        'hours' => 'your second hours', // 11:00-20:00
      ]
    ],
];

统计信息

  • 总下载量: 881
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 0
  • Forks: 1
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固