2017-25 © Pedro Peláez
 

php timekeeper

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

image

midnite81/timekeeper

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

  • Thursday, July 28, 2016
  • by midnite81
  • Repository
  • 2 Watchers
  • 1 Stars
  • 1,607 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 76 % Grown

The README.md

TimeKeeper

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

A series of scopes for Laravel Models to do with Time Management., (*2)

Please note: This project is a work in progress., (*3)

Relationship Diagram

Relationship Diagram, (*4)

Installation

This package requires PHP 5.6+ and Laravel 5., (*5)

To install through composer include the package in your composer.json., (*6)

"midnite81/timekeeper": "0.2.*"

Run composer install or composer update to download the dependencies or you can run composer require midnite81/timekeeper., (*7)

Laravel 5 Integration

There is no service provider to install. Simply include the trait to the model you need to use it on., (*8)

Example Usage

On your model simply add the use statement to the Model you want to use it on., (*9)

use Midnite81\TimeKeeper\Traits\TimeKeeper;

class YourModel
{
    use TimeKeeper;

    // ...

}

Then reference it in your controller or service etc;, (*10)

    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, (*11)

  • 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)

The Versions

28/07 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Simon Rogers

php time scopes

28/07 2016

dev-develop

dev-develop

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

  Sources   Download

MIT

The Requires

 

by Simon Rogers

php time scopes

20/06 2016

0.2.1

0.2.1.0

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

  Sources   Download

MIT

The Requires

 

by Simon Rogers

php time scopes

18/06 2016

0.2.0

0.2.0.0

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

  Sources   Download

MIT

The Requires

 

by Simon Rogers

php time scopes

18/06 2016

0.1.0

0.1.0.0

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

  Sources   Download

MIT

The Requires

 

by Simon Rogers

php time scopes