PHP code example of midnite81 / timekeeper

1. Go to this page and download the library: Download midnite81/timekeeper 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/ */

    

midnite81 / timekeeper example snippets


use Midnite81\TimeKeeper\Traits\TimeKeeper;

class YourModel
{
    use TimeKeeper;

    // ...

}

    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();

        // ...

    }