PHPackages                             lee/work-home-schedule - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. lee/work-home-schedule

ActiveLibrary

lee/work-home-schedule
======================

Estimate working home date with Carbon::mixin

1.1(6y ago)1271MITPHPPHP &gt;=7.2

Since Apr 7Pushed 6y ago1 watchersCompare

[ Source](https://github.com/peter279k/work-home-schedule)[ Packagist](https://packagist.org/packages/lee/work-home-schedule)[ Docs](https://github.com/peter279k/work-home-schedule)[ RSS](/packages/lee-work-home-schedule/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Working Home Schedule
=====================

[](#working-home-schedule)

[![CI](https://github.com/peter279k/work-home-schedule/workflows/CI/badge.svg?branch=master)](https://github.com/peter279k/work-home-schedule/workflows/CI/badge.svg?branch=master)[![Coverage Status](https://camo.githubusercontent.com/1983a306ab0935af2e6eea60a261be60714586d11203fca9d4e5a3cd1f297953/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f70657465723237396b2f776f726b2d686f6d652d7363686564756c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/peter279k/work-home-schedule?branch=master)[![StyleCI](https://camo.githubusercontent.com/4095532ea5e99842db8a1957b4c0c1424df57e9624f1e70f15c77cdeb8e32a6c/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3235333834373237302f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/253847270)

Installation
------------

[](#installation)

- Download `composer` firstly:

```
curl -sS https://getcomposer.org/installer | php
```

- Install `lee/work-home-schedule` secondly:

```
php composer.phar require lee/work-home-schedule:^1
```

Introduction
------------

[](#introduction)

This is about working home schedule to estimate current working status on specific date.

It's based on following scenario for A/B team work:

- A team work from office today, and B team will work from home today.
- A team work from home tomorrow, and B team will work from office tomorrow.
- And so on.

This situation will skip on country holiday and weekend.

Usage
-----

[](#usage)

This class depends on `Carbon::mixin` method.

The code snippets are as follows:

- Set `startDateStatus` about working from home or office.
- Set `csvPath` about specific CSV file path.
- Set `csvHead` about whether CSV file path has head.
- Loading calendar data, the calendar CSV format is available [here](tests/fixtures/2020_calendar.csv).

We assume that the `2020-04-06` is start date and working statuses are as follows:

- The start date status is `office`.

Get next working date about code snippets are as follows:

```
require __DIR__ . '/vendor/autoload.php';

use Carbon\Carbon;
use Lee\WorkHomeSchedule;

$filePath = __DIR__ . '/tests/fixtures/2020_calendar.csv';

$workingHomeSchedule = new WorkHomeSchedule();
$workingHomeSchedule->startDateStatus = 'office'; // The default value is empty string
$workingHomeSchedule->csvPath = $filePath; // The default value is empty string
$workingHomeSchedule->csvHead = true; // The default value is true

$workingHomeSchedule = $workingHomeSchedule->loadCalendarData($filePath);

Carbon::mixin($this->workingHomeSchedule);
$currentDate = Carbon::create('2020-04-06');

$nextWorkingDate = $currentDate->nextWorkingDate();

$carbonDate = $nextWorkingDate['date']; // Carbon::class instance
$carbonDateString = (string)$nextWorkingDate['date']; // 2020-04-07 00:00:00
$workingStatus = $nextWorkingDate['status']; // home
```

Get previous working date about code snippets are as follows:

```
require __DIR__ . '/vendor/autoload.php';

use Carbon\Carbon;
use Lee\WorkHomeSchedule;

$filePath = __DIR__ . '/tests/fixtures/2020_calendar.csv';

$workingHomeSchedule = new WorkHomeSchedule();
$workingHomeSchedule->startDateStatus = 'office'; // The default value is empty string
$workingHomeSchedule->csvPath = $filePath; // The default value is empty string
$workingHomeSchedule->csvHead = true; // The default value is true

$workingHomeSchedule = $workingHomeSchedule->loadCalendarData($filePath);

Carbon::mixin($this->workingHomeSchedule);
$currentDate = Carbon::create('2020-04-06');

$previousWorkingDate = $currentDate->previousWorkingDate();

$carbonDate = $previousWorkingDate['date']; // Carbon::class instance
$carbonDateString = (string)$previousWorkingDate['date']; // 2020-04-01 00:00:00
$workingStatus = $previousWorkingDate['status']; // home
```

Get next working dates with specific date ranges about code snippets are as follows:

```
require __DIR__ . '/vendor/autoload.php';

use Carbon\Carbon;
use Lee\WorkHomeSchedule;

$filePath = __DIR__ . '/tests/fixtures/2020_calendar.csv';

$workingHomeSchedule = new WorkHomeSchedule();
$workingHomeSchedule->startDateStatus = 'office'; // The default value is empty string
$workingHomeSchedule->csvPath = $filePath; // The default value is empty string
$workingHomeSchedule->csvHead = true; // The default value is true
$workingHomeSchedule->workingDays = 2; // The default value is 1

$workingHomeSchedule = $workingHomeSchedule->loadCalendarData($filePath);

Carbon::mixin($this->workingHomeSchedule);
$currentDate = Carbon::create('2020-04-06');

$nextWorkingDates = $currentDate->nextWorkingDates(); // The array length is 2

$nextWorkingDates[0]['date'] // Carbon::class instance
(string)$nextWorkingDates[0]['date'] // 2020-04-07 00:00:00
$nextWorkingDates[0]['status'] // home

$nextWorkingDates[1]['date'] // Carbon::class instance
(string)$nextWorkingDates[1]['date'] // 2020-04-08 00:00:00
$nextWorkingDates[1]['status'] // office
```

Get previous working dates with date ranges about code snippets are as follows:

```
require __DIR__ . '/vendor/autoload.php';

use Carbon\Carbon;
use Lee\WorkHomeSchedule;

$filePath = __DIR__ . '/tests/fixtures/2020_calendar.csv';

$workingHomeSchedule = new WorkHomeSchedule();
$workingHomeSchedule->startDateStatus = 'office'; // The default value is empty string
$workingHomeSchedule->csvPath = $filePath; // The default value is empty string
$workingHomeSchedule->csvHead = true; // The default value is true
$workingHomeSchedule->workingDays = 2; // The default value is 1

$workingHomeSchedule = $workingHomeSchedule->loadCalendarData($filePath);

Carbon::mixin($this->workingHomeSchedule);
$currentDate = Carbon::create('2020-04-06');

$previousWorkingDates = $currentDate->previousWorkingDates(); // array length is 2

$previousWorkingDates[0]['date'] // Carbon::class instance
(string)$previousWorkingDates[0]['date'] // 2020-04-01 00:00:00
$previousWorkingDates[0]['status'] // home

$previousWorkingDates[1]['date'] // Carbon::class instance
(string)$previousWorkingDates[1]['date'] // 2020-03-31 00:00:00
$previousWorkingDates[1]['status'] // office
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

2

Last Release

2219d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/baa74b27c760b02871b04908382ae01967e7d7100c20144c71197cd680b99c98?d=identicon)[peter279k](/maintainers/peter279k)

---

Top Contributors

[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lee-work-home-schedule/health.svg)

```
[![Health](https://phpackages.com/badges/lee-work-home-schedule/health.svg)](https://phpackages.com/packages/lee-work-home-schedule)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M344](/packages/tymon-jwt-auth)[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[spatie/laravel-sitemap

Create and generate sitemaps with ease

2.6k14.6M107](/packages/spatie-laravel-sitemap)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M718](/packages/statamic-cms)[spatie/laravel-route-attributes

Auto register routes using PHP attributes

879963.2k17](/packages/spatie-laravel-route-attributes)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k379.4k24](/packages/team-reflex-discord-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
