PHPackages                             flexic/cron-builder - 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. flexic/cron-builder

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

flexic/cron-builder
===================

 Builder for cronjob expressions.

1.0.0(3y ago)01951GPL-3.0-or-laterPHPPHP ^8.1

Since Jan 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/flexicsystems/cron-builder)[ Packagist](https://packagist.org/packages/flexic/cron-builder)[ RSS](/packages/flexic-cron-builder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (1)

🌗 Cron Builder
--------------

[](#-cron-builder)

This package provides a builder for cron expressions.

### Installation

[](#installation)

```
composer require flexic/cron-builder
```

### Usage

[](#usage)

```
use Flexic\CronBuilder\CronBuilder;

$cron = CronBuilder::create()
    ->everyMinute()
    ->build();
// * * * * *

$cron = CronBuilder::create()
    ->atMinuteInterval(5)
    ->build();
// */5 * * * *

$cron = CronBuilder::create()
    ->notOnDaysOfWeek(3, 4)
    ->build();
// * * * * 1,2,5,6,0
```

The builder returns an object of type `Flexic\CronBuilder\Cron`. This object allows to get the complete cron or only parts of it. It can also be converted to a string.

### Methods

[](#methods)

#### Builder

[](#builder)

MethodDescriptioncreate()Creates a new instance of the builder. (Method is static called)build()Builds the cron expression.everyMinute()atMinuteInterval($interval)atMinute($minute)atMinutes($minutes)betweenMinutes($from, $to)everyHour()atHourInterval($interval)atHour($hour)atHours($hours)notAtHours($hours)betweenHours($from, $to)everyDay()onDayInterval($interval)onDay($day)onDays($days)betweenDays($from, $to)inJanuary()inFebruary()inMarch()inApril()inMay()inJune()inJuly()inAugust()inSeptember()inOctober()inNovember()inDecember()inMonth($month)everyMonth()onMonthInterval($interval)onSunday()onMonday()onTuesday()onWednesday()onThursday()onFriday()onSaturday()onDayOfWeek($weekday)onDaysOfWeek($weekdays)betweenDaysOfWeek($from, $to)notOnDaysOfWeek($weekdays)onWeekend()onWeekdays()everyWeekday()onWeekdayInterval($interval)hourly()hourlyAt($minute)daily()weekly()monthly()quarterly()yearly()#### Cron

[](#cron)

MethodDescriptionReturn FormatgetCron()Returns the complete cron expressionstringgetMinuteExpression()Returns the minute expressionExpression ObjectgetHourExpression()Returns the hour expressionExpression ObjectgetDayOfMonthExpression()Returns the day of month expressionExpression ObjectgetMonthExpression()Returns the month expressionExpression ObjectgetDayOfWeekExpression()Returns the day of week expressionExpression Object\_\_toString()Returns the complete cron expressionstring#### Lexer

[](#lexer)

Lexer is used to parse the cron expression into tokens.

MethodDescriptionReturn FormatfromString()Parses the cron expression into tokensCron Object

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

1228d ago

### Community

Maintainers

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

---

Top Contributors

[![ThemePoint](https://avatars.githubusercontent.com/u/28843201?v=4)](https://github.com/ThemePoint "ThemePoint (23 commits)")

---

Tags

buildercronexpressioncronjob

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/flexic-cron-builder/health.svg)

```
[![Health](https://phpackages.com/badges/flexic-cron-builder/health.svg)](https://phpackages.com/packages/flexic-cron-builder)
```

###  Alternatives

[dragonmantank/cron-expression

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due

4.7k474.1M487](/packages/dragonmantank-cron-expression)[lorisleiva/cron-translator

Makes CRON expressions human-readable

3148.5M31](/packages/lorisleiva-cron-translator)[spatie/regex

A sane interface for php's built in preg\_\* functions

1.1k17.1M59](/packages/spatie-regex)[kris/laravel-form-builder

Laravel form builder - symfony like

1.7k2.2M45](/packages/kris-laravel-form-builder)[liebig/cron

Job scheduling for Laravel

455224.3k](/packages/liebig-cron)[gherkins/regexpbuilderphp

PHP port of thebinarysearchtree/regexpbuilderjs

1.4k163.0k1](/packages/gherkins-regexpbuilderphp)

PHPackages © 2026

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