mchampaneri/timeslicer
Composer 安装命令:
composer require mchampaneri/timeslicer
包简介
A plugable laravel package to generate time slots of particular time interval for any time range.
README 文档
README
Laravel 5 package for generating time slots for a time duration
Changes
- 'GUI support Removed '
- 'Enhanced backend support with new functions'
- 'Time Clock converter added'
Description
laravel-timeslicer is a s package that generates time slots of same length from starting time to ending time for a range of days,months or even years. You can create slots of differnt time lengths or/and differnt starting or/and ending time for differnt interval of days by changing the inputs accordingly.
Installation
First Get It Through The Composer
composer require mchampaneri/timeslice
Copy The ServiceProvider To config/app.php in providers array
mchampaneri\timeslicer\TimeslicerServiceProvider::class
Copy The Facade To config/app.php in aliases array
mchampaneri\timeslicer\TimeslicerServiceProvider::class
Second You have to publish the package
php artisan vendor:publish
This command will publish all assets file need by the package at appropriate direcotries.
Third do Migrate
php artisan migrate
Here migrate is neccesary because this package has its own table to manage timeslots and related data
After This Three Steps are ready to use the timeslicer
Setup
At first you have to set the config file of timeslicer. Define the name of your resource model, consumer model and namespace of your model files.
Resource model : Model For Which You Want To Genreate The Time Slots
for example doctors, resturant's table, class of school
Consumer Model : Model Which are going to relate with Resource object throgh Timeslice
for example patient, customer , subject
Here this names are Case Sensitive so add this name carefully.
In the second step you are ready to use this package where ever you want
Functions
MakeSlices($start_date, $end_date, $start_time, $end_time, $interval, $resource_id)
Function generates the unique time slices based on the date, start time and end time for start date to the end date here all variables are the fields of the table.
Book($consumer_id)
Here Consumer_id is The id of a consumer object. This function will book the current timeslice for the consumer object which's id is passed as argument.
UnBook()
Unbook the current timeslice from the reservation
OfResource()
Returns the resource object which is related with the current timeslice.
ForConsumer()
Returns the consumer object which is related with the current timeslice.
SliceOfResource($id)
Returns the all time slices created for the particular resource.
SliceOfResourceDay($id, $on)
Returns the all time slices of the resource on the particular date.
BookedSliceOfResourceDay($id, $on)
Returns the all booked time slices of the resource **on** the particular **date**.
unBookedSliceOfResourceDay($id, $on)
Returns the all unbooked/free time slices of the resource **on** the particular **date**.
```
TimeConverter($string)
```
Returns the input of 12hr clock in 24hr clock output
```
rTimeConverter($string)
```
Returns the input of 24hr clock in 12hr clock with appropriate suffix ie am/pm
mchampaneri/timeslicer 适用场景与选型建议
mchampaneri/timeslicer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.04k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2016 年 06 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「Time slicer」 「Time Management」 「Time slot Plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mchampaneri/timeslicer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mchampaneri/timeslicer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mchampaneri/timeslicer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Tools to convert between .NET and PHP date formats
Adds the EDTF data type to Wikibase
Date component is a set of methods to help with the manipulation of dates.
Bureaux A Partager Edit - Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js
Delayed Process For Laravel.
Temporal frequency library
统计信息
- 总下载量: 4.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: opensource
- 更新时间: 2016-06-28