PHPackages                             vinelab/oclock - 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. vinelab/oclock

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

vinelab/oclock
==============

Laravel package that reports scheduled events.

v0.1.3(9y ago)11192MITPHP

Since Jan 9Pushed 9y ago2 watchersCompare

[ Source](https://github.com/Vinelab/oclock)[ Packagist](https://packagist.org/packages/vinelab/oclock)[ RSS](/packages/vinelab-oclock/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (7)Versions (5)Used By (0)

OClock
======

[](#oclock)

Explore the details of scheduled events in a Laravel application.

### What is this?

[](#what-is-this)

There are times when you have too many schedules registered to run at different times, be it in the same application or multiple applications, i.e. in a micro-services architecture where multiple services have their work scheduled to perform different events at different times, it becomes crucial to have one central place that can navigate these scheduled events from across the different applications (services, projects, etc.). The way OClock achieves this is as follows:

#### Definitions

[](#definitions)

- **Source**: The application/project where the events have been defined and scheduled.
- **Event**: Is a scheduled event that includes the command and Cron expression that defines its running schedule.
- **Session**: A single run of a scheduled Event. i.e. if an Event is scheduled to run every five minutes each of these runs throughout the day is a Session.
- **Schedule**: A collection of Events with their Source information.

1. Send the session output to a file where we can read them later
2. Set the `before` hook on each of the events to store their session information in the database every time they start.
3. Set the `after` hook on each of the events to:
    - update their session information and mark the session as done, meanwhile the running status flag `is_running` will be marked as `true`.
    - Read the session output from the file and add it to the Session record in the database
    - Remove the file

Requirements
------------

[](#requirements)

- [MongoDB Extension](http://php.net/manual/en/mongodb.installation.pecl.php)

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

[](#installation)

```
composer require vinelab/oclock

```

Configuration
-------------

[](#configuration)

- Add the service provider `OClock\OClockServiceProvider::class,` to the `providers` array in `config/app.php`
- Add the mongodb configuration to `config/database.php` as follows:

```
'default' => env('DB_CONNECTION', 'mongodb'),
```

```
'connections' => [

    'mongodb' => [
        'driver'   => 'mongodb',
        'host'     => env('DB_HOST', 'localhost'),
        'port'     => env('DB_PORT', 27017),
        'database' => env('DB_DATABASE', 'logs'),
        'username' => env('DB_USERNAME'),
        'password' => env('DB_PASSWORD'),
        'options' => [
            'database' => 'admin' // sets the authentication database required by mongo 3
        ]
    ],
]
```

- Update `.env` file with the correct parameters

```
# MongoDB
DB_HOST=localhost
DB_PORT=27017
DB_DATABASE=logs
DB_USERNAME=
DB_PASSWORD=

```

Usage
-----

[](#usage)

### Setup

[](#setup)

- In the `schedule` method of `app/Console/Kernel.php` add the following to the bottom (after all the schedules have been defined):

```
protected function schedule(Schedule $schedule)
{
    // register schedules here

    // ...

    OClock::register($schedule);
}
```

Make sure you import the facade by adding `use OClock;` to the top of the file.

### Methods

[](#methods)

- `OClock::sessions`: Get all the stored sessions
- `OClock::sessionsByDay`: Get all the sessions grouped by day
- `OClock::sessionsForEvent($eventId)`: Get the sessions for the given event

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

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

Total

4

Last Release

3456d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4564469?v=4)[Sociata](/maintainers/Vinelab)[@Vinelab](https://github.com/Vinelab)

---

Top Contributors

[![Mulkave](https://avatars.githubusercontent.com/u/2647333?v=4)](https://github.com/Mulkave "Mulkave (15 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vinelab-oclock/health.svg)

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

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M169](/packages/laravel-ai)[livewire/flux

The official UI component library for Livewire.

9527.8M124](/packages/livewire-flux)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M131](/packages/laravel-mcp)[spatie/laravel-export

Create a static site bundle from a Laravel app

673139.5k6](/packages/spatie-laravel-export)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

198321.1k](/packages/fumeapp-modeltyper)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

721160.4k12](/packages/tallstackui-tallstackui)

PHPackages © 2026

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