PHPackages                             vij-klim/appointed - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. vij-klim/appointed

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vij-klim/appointed
==================

Check whether required appointment slot is open or offer closest available one

0.7.0(4y ago)010MITPHPPHP &gt;=5.6.0

Since Jul 2Pushed 4y agoCompare

[ Source](https://github.com/vijKlim/appointed)[ Packagist](https://packagist.org/packages/vij-klim/appointed)[ RSS](/packages/vij-klim-appointed/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (16)Used By (0)

![GitHub tag](https://camo.githubusercontent.com/11fbd63837d902745aaaee68ad46b68bc545039f8670b5603d7f62824f9188a4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f6170706c6963617a7a612f6170706f696e7465642e737667) ![license](https://camo.githubusercontent.com/3b3209818e93eed67ecee77bc19846f9e7b0416fa7135346e4db07c7bd39cfea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6170706c6963617a7a612f6170706f696e7465642e737667) ![Packagist](https://camo.githubusercontent.com/dd23865311427cf06ff45cf95a30fd663542cf7fdab464b87b71634764bd6c7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6170706c6963617a7a612f6170706f696e7465642e737667)

Installation
============

[](#installation)

```
composer require applicazza/appointed

```

Usage
=====

[](#usage)

- Set up default timezone, i.e.

```
date_default_timezone_set('Asia/Jerusalem');
```

- Instantiate business day

```
use Applicazza\Appointed\BusinessDay;

// ...
$business_day = new BusinessDay;
```

- Create some operating periods and add them to business day. If some operating periods cannot be added then false will be returned and no changes will be applied whatsoever

```
use Applicazza\Appointed\Period;

// ...

$period_0900_1400 = Period::make(today( 9, 00), today(14, 00));
$period_1600_1900 = Period::make(today(16, 00), today(19, 00));

$business_day->addOperatingPeriods(
    $period_1600_1900,
    $period_0900_1400
);
```

- Create some appointments and add them to business day. If some appointments cannot be added then false will be returned and no changes will be applied whatsoever

```
use Applicazza\Appointed\Appointment;

// ...

$appointment_1100_1130 = Appointment::make(today( 11, 00), today(11, 30));
$appointment_1200_1330 = Appointment::make(today( 12, 00), today(13, 30));

$business_day->addAppointments(
    $appointment_1100_1130,
    $appointment_1200_1330
);
```

- To fit previously failed appointment use `BusinessDay::fit(Appointment $appointment, $direction = 'forward')` that will return either null or recommended Appointment

```
$business_day->fit($appointment_1300_1330, 'backward');
$business_day->fit($appointment_1300_1330);
```

- To delete appointment(s) use `BusinessDay::deleteAppointments(Appointment ...$appointment)` that will return boolean

```
$business_day->deleteAppointments($appointment_1300_1330);
```

- To delete operating period use `BusinessDay::deleteOperatingPeriod(Period $period)` that will return boolean

```
$business_day->deleteOperatingPeriod($period_0900_1400)
```

- To edit operating period use `BusinessDay::editOperatingPeriod(Period $old_period, Period $new_period)` that will return boolean

```
$business_day->editOperatingPeriod($period_1330_1400, $period_1330_1430)
```

- To get whole day agenda use `BusinessDay::getAgenda()` that will return array of Period and/or Appointment ordered ascending. Since underlying classes implement JsonSerializable interface this data may be easily encoded to json.

```
$agenda = $business_day->getAgenda();
// To pretty print results
echo json_encode($business_day->getAgenda(), JSON_PRETTY_PRINT), PHP_EOL;
```

Helpers
-------

[](#helpers)

```
use function Applicazza\Appointed\interval;
use function Applicazza\Appointed\today;
// ...
interval($hours = 0, $minutes = 0, $seconds = 0);
today($hours = 0, $minutes = 0, $seconds = 0);
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~140 days

Recently: every ~453 days

Total

14

Last Release

1468d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/08a50574c93b82b95c35379209bb42b301ff944d03fcb6ed5ae471757f61740b?d=identicon)[vijKlim](/maintainers/vijKlim)

---

Top Contributors

[![applicazza](https://avatars.githubusercontent.com/u/11618621?v=4)](https://github.com/applicazza "applicazza (15 commits)")[![vijKlim](https://avatars.githubusercontent.com/u/40484457?v=4)](https://github.com/vijKlim "vijKlim (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vij-klim-appointed/health.svg)

```
[![Health](https://phpackages.com/badges/vij-klim-appointed/health.svg)](https://phpackages.com/packages/vij-klim-appointed)
```

###  Alternatives

[illuminate/support

The Illuminate Support package.

630113.0M41.0k](/packages/illuminate-support)[spatie/holidays

Calculate public holidays

402860.1k2](/packages/spatie-holidays)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

293952.6k30](/packages/craftcms-feed-me)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k17](/packages/solspace-craft-freeform)[pimcore/data-importer

Adds a comprehensive import functionality to Pimcore Datahub

46855.5k5](/packages/pimcore-data-importer)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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