PHPackages                             sodecl/scheduler - 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. sodecl/scheduler

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

sodecl/scheduler
================

Scheduler library

v0.1.2(2y ago)012MITPHP

Since Feb 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sodecl/scheduler)[ Packagist](https://packagist.org/packages/sodecl/scheduler)[ RSS](/packages/sodecl-scheduler/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Sodecl Scheduler Library
========================

[](#sodecl-scheduler-library)

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

[](#introduction)

Sodecl Scheduler is a PHP library designed for creating and managing a customizable schedule of time slots. It's particularly useful for applications that require precise control over operational hours, appointments, breaks, and scheduling constraints. Leveraging the Carbon library for date and time manipulation, Sodecl Scheduler offers a powerful yet flexible way to handle complex scheduling needs.

Features
--------

[](#features)

- Flexible time slot configuration (e.g., 1 hour or 15 minutes blocks).
- Customizable working days and operational hours.
- Support for managing lunch breaks within the schedule.
- Ability to exclude specific time slots.
- Integration with Carbon for robust date and time handling.

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

[](#installation)

To install the Sodecl Scheduler, you will need Composer, a dependency manager for PHP.

Run the following command in your project directory:

```
composer require sodecl/scheduler
```

Usage
-----

[](#usage)

### Basic Setup

[](#basic-setup)

First, ensure you import the necessary classes from the library:

```
use Sodecl\Scheduler\Schedule;
use Sodecl\Scheduler\ScheduleConfig;
use Sodecl\Scheduler\TimeSlot;
```

### Schedule Configuration

[](#schedule-configuration)

Create a `ScheduleConfig` object to define your schedule parameters:

```
$scheduleConfig = ScheduleConfig::make()
    ->openingHour('08:00')
    ->closingHour('17:00')
    ->lunchBreak()
    ->lunchBreakStart('12:00')
    ->lunchBreakDuration(60) // in minutes
    ->slotMinutes(60)
    ->days(['monday', 'tuesday', 'wednesday', 'thursday', 'friday'])
    ->scheduleStart(now()->startOfMonth())
    ->scheduleEnd(now()->endOfMonth());
```

### Creating a Schedule

[](#creating-a-schedule)

Instantiate the `Schedule` class with your configuration:

```
$schedule = new Schedule($scheduleConfig);
```

### Generating Time Slots

[](#generating-time-slots)

Generate time slots for a specific day:

```
$date = today(); // Carbon instance for the date
$slotsTaken = []; // Array of TimeSlot objects representing booked slots

$timeSlots = $schedule->timeSlotsFor($date, $slotsTaken);
```

Examples
--------

[](#examples)

### Example 1: 1 Hour Time Blocks

[](#example-1-1-hour-time-blocks)

This example demonstrates setting up a schedule with 1-hour blocks, excluding lunch hours:

```
$scheduleConfig = ScheduleConfig::make()
    ->openingHour('08:00')
    ->closingHour('17:00')
    ->lunchBreak()
    ->lunchBreakStart('12:00')
    ->lunchBreakDuration(60) // in minutes
    ->slotMinutes(60)
    ->days(['monday', 'tuesday', 'wednesday', 'thursday', 'friday'])
    ->scheduleStart(now()->startOfMonth())
    ->scheduleEnd(now()->endOfMonth());
```

### Example 2: 15 Minute Time Blocks

[](#example-2-15-minute-time-blocks)

In this example, the schedule is set for 15-minute time slots without a lunch break:

```
$scheduleConfig = ScheduleConfig::make()
    ->openingHour('08:00')
    ->closingHour('17:00')
    ->lunchBreak()
    ->lunchBreakStart('12:00')
    ->lunchBreakDuration(60) // in minutes
    ->slotMinutes(15)
    ->days(['monday', 'tuesday', 'wednesday', 'thursday', 'friday'])
    ->scheduleStart(now()->startOfMonth())
    ->scheduleEnd(now()->endOfMonth());
```

Contributing
------------

[](#contributing)

Contributions to the Sodecl Scheduler are welcome. Please ensure to follow the project's code standards and submit your pull requests for review.

License
-------

[](#license)

MIT

---

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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 ~1 days

Total

2

Last Release

859d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/497d3dd414247d44d8943533c03e5e69613f037bb891fdf0ac3382166a7c7ae3?d=identicon)[cfuentessalgado](/maintainers/cfuentessalgado)

---

Top Contributors

[![cfuentessalgado](https://avatars.githubusercontent.com/u/8118712?v=4)](https://github.com/cfuentessalgado "cfuentessalgado (13 commits)")

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/sodecl-scheduler/health.svg)

```
[![Health](https://phpackages.com/badges/sodecl-scheduler/health.svg)](https://phpackages.com/packages/sodecl-scheduler)
```

###  Alternatives

[illuminate/support

The Illuminate Support package.

630113.0M41.3k](/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.6k33](/packages/craftcms-feed-me)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k18](/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)
