PHPackages                             felixdorn/nest - 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. felixdorn/nest

ActiveLibrary

felixdorn/nest
==============

Nest is a simple pseudo-programming language for defining repeatable and non-repeatable events in time.

0.1.0(4y ago)025MITPHPPHP ^8.0

Since Aug 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/felixdorn/nest)[ Packagist](https://packagist.org/packages/felixdorn/nest)[ RSS](/packages/felixdorn-nest/feed)WikiDiscussions master Synced 4w ago

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

[![Nest written in blue on a lighter blue background](art/banner.svg)](art/banner.svg)

Nest
====

[](#nest)

[![Tests](https://github.com/felixdorn/nest/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/felixdorn/nest/actions/workflows/tests.yml)[![Formats](https://github.com/felixdorn/nest/actions/workflows/formats.yml/badge.svg?branch=master)](https://github.com/felixdorn/nest/actions/workflows/formats.yml)[![License](https://camo.githubusercontent.com/03fe840e8567d6710928826e8cc95a95a545b342125ea421622f071fd14d1daf/68747470733a2f2f706f7365722e707567782e6f72672f66656c6978646f726e2f6e6573742f6c6963656e7365)](//packagist.org/packages/felixdorn/nest)

Nest is a simple pseudo-programming language for defining repeatable and non-repeatable events in time.

Here are a couple examples of the syntax:

```
everyday at 7:00 for 3 minutes

```

```
tomorrow at 17:30 for an hour

```

```
every monday, saturday and sunday at 2 for 1h until 15/6/2021

```

Nest outputs a list of time periods.

Here's an example output for `once 1/1/2021 from 15:00 to 16:00`:

```
[
    ["starts_at" => "2021-01-01 15:00:00", "ends_at" => "2021-01-01 16:00:00"]
]
```

Features
========

[](#features)

- Natural syntax
- Error reporting
- Fast

Already know this stuff? [Jump to the API documentation](#api)

Reproducibility
---------------

[](#reproducibility)

The same code could lead to a completely different output based on the current time.

Therefore, when storing Nest code, you should also store the current time if reproducibility is an issue for you (it probably is).

Keywords
--------

[](#keywords)

### Once

[](#once)

Once indicates that an event is repeated once at a given date.

```
for a day once 15/04/2005

```

#### Implicit once

[](#implicit-once)

You may omit the once keyword if you write it at the start of the program.

`15/04/2005` processed as `once 2005-04-15`

`at 6 15/04/2005` throws `Syntax error, unexpected 15/04/2005`

### Every

[](#every)

Every indicates that an event is repeated it takes as a parameter one or many weekdays.

```
every monday and saturday

```

See how lists work [here](#lists).

You may use the shorthand `everyday` that compiles to every day of the week

```
everyday at 6:30

```

You may also use the shorthand `weekend` that compiles to `saturday and sunday`

```
every weekend

```

### For

[](#for)

For indicates how long an event lasts.

```
for one hour

```

Here's a guide on [How you can quantify time in Nest](#quantifying-time)

Here's a list of all the time measurement units you may use:

- minute
- hour
- day
- week

You may pluralize them to keep the sentence grammatically correct but the compiler won't pick up on it if you don't.

Shorthands such as `1h` (1 hour) are also allowed.

Here's a list of all available shorthands:

- m: minute
- h: hour
- d: day
- w: week
- min: minute

In
--

[](#in)

In sets the date of a non-repeatable event relatively to the current date.

```
in 5 days

```

Refer to the [for keyword](#for) for a guide on time measurement units and how to quantify time.

Between
-------

[](#between)

Between constrains the event between two dates.

```
between 12/04/2021 and 12/12/2021

```

If you wish to constrain an event between a time range, use [from](#from--to-).

From ... to ...
---------------

[](#from--to-)

From constrains the event between a time range.

```
from 22:00 to 23:05

```

Until
-----

[](#until)

Until is a shorthand for the [between](#between) keyword.

```
until 12/12/2021

```

The start date is the current time.

At
--

[](#at)

At defines at which time an event starts. It is often used in combination with `for` that sets the duration of the event.

```
at 6 for an hour

```

Lists
-----

[](#lists)

A list contains one or many literals such as `monday` or `1:00` and these are separated with commas or the word `and`.

```
monday, saturday and sunday
1:00,16:00
tuesday and sunday, monday
monday, saturday, sunday

```

Quantifying Time
----------------

[](#quantifying-time)

You can use any number from `one` to a `sixty` in literal form.

```
for fifty-five minutes

```

You can use any non-negative integer such as `1` or `42`.

```
for 10 hours

```

To represent one unit of time, you may use a simpler form:

```
for an hour
for a day

```

> The compiler doesn't make a difference if you write `a` or `an` so `for a hour` still represents `1 hour` even though it is grammatically incorrect.

API
---

[](#api)

### Installation

[](#installation)

If you don't have composer, you can download it [here](https://getcomposer.org/download).

```
composer require felixdorn/nest
```

### Usage

[](#usage)

```
\Felix\Nest\Nest::compile(
    'everyday for an hour at 12',
    \Carbon\CarbonPeriod::create(
        \Carbon\Carbon::now(),
        \Carbon\Carbon::now()->addWeek()
    )
    # Optionally, you can also pass the current time as a third parameter.
    # \Carbon\Carbon::now()
)
```

If your event does not have fixed boundaries set using `between ... and ...` or `until ...`, it repeats indefinitely. Therefore, you need to set manual boundaries at compile-time hence the second `CarbonPeriod` parameter. You can omit it if you know that your event has fixed boundaries.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

1719d ago

### Community

Maintainers

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

---

Top Contributors

[![felixdorn](https://avatars.githubusercontent.com/u/55788595?v=4)](https://github.com/felixdorn "felixdorn (60 commits)")

---

Tags

package

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/felixdorn-nest/health.svg)

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

###  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.2M720](/packages/statamic-cms)[team-reflex/discord-php

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

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

Temporal SDK

4002.2M18](/packages/temporal-sdk)

PHPackages © 2026

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