PHPackages                             schubu/cronify - 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. schubu/cronify

ActiveLibrary

schubu/cronify
==============

Adds cron functionality to your models.

1.1.1(5y ago)017MITPHPPHP ^7.1

Since Feb 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/SchuBu/cronify)[ Packagist](https://packagist.org/packages/schubu/cronify)[ Docs](https://github.com/schubu/cronify)[ RSS](/packages/schubu-cronify/feed)WikiDiscussions master Synced 1w ago

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

Cronify Package
===============

[](#cronify-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f968993bc2fa15a2757314e6f46d001b1c6e79f26ae9cca689c9dd3cfef0baa9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7363687562752f63726f6e6966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/schubu/cronify)[![Build Status](https://camo.githubusercontent.com/ef42e3d4da94ab484f2c9275fe51b1ccaf6012d596c488ff6754d1c1b37e3278/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7363687562752f63726f6e6966792f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/schubu/cronify)[![Quality Score](https://camo.githubusercontent.com/0da627921be072bc52dcbbc7cc6c000a56e917f5fc47c095e4d21d8572617fda/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7363687562752f63726f6e6966792e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/schubu/cronify)[![Total Downloads](https://camo.githubusercontent.com/62b73d7212c5a2001b7b591f9e3842307dc16079b8607e45571279e46c8db1ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7363687562752f63726f6e6966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/schubu/cronify)

Add cron-patterns to your models to check for validity. For example: you can check if a given post should be viewed.

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

[](#installation)

You can install the package via composer:

```
composer require schubu/cronify
```

After you've installed the package please run the installer. It published the migration file.

```
php artisan cronify:install
```

After that you've got to run your migration

```
php artisan migrate
```

A new crons table is added to your database. It stores your cron entries for your models.

Cronify your models
-------------------

[](#cronify-your-models)

Next step is to add the Cronable trait to your models.

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Schubu\Cronify\Traits\Cronable;

class Post extends Model
{
    use Cronable;

    // ...
}
```

Usage
-----

[](#usage)

Given you've a post model with a title and a body field here is how to add a post with a cron pattern:

```
$post = Post::create([
    "title"=>"Your title",
    "body" => "Lorem ipsum"
]);

$post->crons()->create([
    'pattern' => '* * 1 1 *'
]);
```

In this case you can ask for your pattern if it is due:

```
App\Models\Post::latest()->first()->isDue()
```

In our example it returns true only for the first of january.

Hints
-----

[](#hints)

You can add multiple cron patterns. If at least one rule matches you get true.

You can provide a date for the method `->isDue($timestamp) ` so you can check the due of your model at a given date.

Validation
----------

[](#validation)

You can validate a submitted cron pattern by using `CronPatternRule`

```
['cron' => ['array', new CronPatternRule]]
```

Submit your cron pattern as an associative array with the keys `minute, hour, day, month, weekday`. If you submit the pattern as a string please split it into an array.

Roadmap
-------

[](#roadmap)

- add different rules for validation of a provided string and a provided array `array: new CronPatternArrayRule` and `string: new CronPatternStringRule`
- integrate a form component
- integrate testing

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Peter Schulze-Buxloh](https://github.com/schubu)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

1880d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f0a9c4d63038e4321c6c9dc7e9b531297a996806848dabb5bdaac75a97fcfd4?d=identicon)[SchuBu](/maintainers/SchuBu)

---

Top Contributors

[![SchuBu](https://avatars.githubusercontent.com/u/30638214?v=4)](https://github.com/SchuBu "SchuBu (8 commits)")

---

Tags

schubucronify

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/schubu-cronify/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)

PHPackages © 2026

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