承接 midnite81/timekeeper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

midnite81/timekeeper

Composer 安装命令:

composer require midnite81/timekeeper

包简介

A series of scopes for Laravel Models to do with Time Management.

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

A series of scopes for Laravel Models to do with Time Management.

Please note: This project is a work in progress.

Relationship Diagram

Relationship Diagram

Installation

This package requires PHP 5.6+ and Laravel 5.

To install through composer include the package in your composer.json.

"midnite81/timekeeper": "0.2.*"

Run composer install or composer update to download the dependencies or you can run composer require midnite81/timekeeper.

Laravel 5 Integration

There is no service provider to install. Simply include the trait to the model you need to use it on.

Example Usage

On your model simply add the use statement to the Model you want to use it on.

use Midnite81\TimeKeeper\Traits\TimeKeeper;

class YourModel
{
    use TimeKeeper;

    // ...

}

Then reference it in your controller or service etc;

    public function check() {

        $overlap = YourModel::overlapsWith('2016-01-01 15:32:00', '2016-01-01 16:46:00')->exists();
        $after = YourModel::after('2016-01-01 10:00:00', 2016-01-01 11:00:00', 'start', 'end')->exists();

        // ...

    }

All scopes take the following arguments

  • Start DateTime (yyyy-mm-dd hh:ii)
  • End DateTime (yyyy-mm-dd hh:ii)
  • Start Time Column in Database (optional, defaults to start_time)
  • End Time Column in Database (optional, defaults to end_time)

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固