PHPackages                             trig/laracron - 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. [CLI &amp; Console](/categories/cli)
4. /
5. trig/laracron

ActiveLibrary[CLI &amp; Console](/categories/cli)

trig/laracron
=============

This tool adds a capability to manage your Cron-based CLI tasks via simple JSON configuration

v0.1.2(7y ago)031PHP

Since Sep 21Pushed 7mo agoCompare

[ Source](https://github.com/trig/laracron)[ Packagist](https://packagist.org/packages/trig/laracron)[ RSS](/packages/trig-laracron/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (9)Versions (5)Used By (0)

Laracron
========

[](#laracron)

This tool adds a capability to manage your Cron-based CLI tasks via simple JSON configuration. Once configured it allows you to control you scheduled tasks without plain old Cron interface. Inspired by Laravel [Task Scheduling](https://laravel.com/docs/5.6/scheduling)

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

[](#installation)

Manager designed to be used as phar executable, so you need to build it first. Clone project first:

```
git clone --depth 1 https://github.com/trig/lara-cron.git
cd lara-cron

```

Then compile Phar executable with the following command:

```
php -dphar-readonly=0 bin/laracron.php build:phar

```

After this step you will find `laracron.phar` file in the current directory. Then you need to add only one Cron task:

```
* * * * * cd /path-to-your-project && php laracron.phar schedule:run >> /dev/null 2>&1

```

That's all it needs.

Usage
-----

[](#usage)

Now you can configure manager for your project needs, just copy `laracron.phar` file to your project root folder. Here are default configuration file (laracron.json):

```
{
  "scheduledJobs": {
    "everyMinute": [
      "php --version"
    ],
    "* * * * *": [
    ]
  },

  "cache.default": "file",

  "log_to": "laracron_cache/laracron.log",
  "cache.prefix": "laracron",

  "cache.stores.file": {
    "driver": "file",
    "path": "laracron_cache"
  },

  "cache.stores.redis": {
    "driver": "redis",
    "host": "localhost",
    "password": null,
    "port": 6379,
    "database": 0
  }
}

```

Here is the brief description for each configuration option:

#### `scheduledJobs`

[](#scheduledjobs)

Is the main configuration option, needed for scheduling you CLI commands, it is a JSON object with keys standing for Cron job definition of specific method names. You can see full list on [Task Scheduling](https://laravel.com/docs/5.6/scheduling) page. Here are some examples:

MethodDescription-&gt;cron('\* \* \* \* \*');Run the task on a custom Cron schedule-&gt;everyMinute();Run the task every minute-&gt;everyFiveMinutes();Run the task every five minutes-&gt;everyTenMinutes();Run the task every ten minutes-&gt;everyFifteenMinutes();Run the task every fifteen minutes-&gt;everyThirtyMinutes();Run the task every thirty minutes-&gt;hourly();Run the task every hour-&gt;daily();Run the task every day at midnight-&gt;weekly();Run the task every week-&gt;monthly();Run the task every month-&gt;quarterly();Run the task every quarter-&gt;yearly();Run the task every yearSo, based on the above description, let's define some simple task and schedule it to run each 15 minutes, just omit object access operator and parenthesis for the definition:

```
...
"scheduledJobs": {
    "everyFifteenMinutes": [
      "echo 'Hey, I\'ll execute each 15 minutes'"
    ],
    // or just like you define a regular cron job:
    "*/15 * * * *": [
      "echo 'Hey, I\'ll execute each 15 minutes'"
    ]
},
...

```

You may have noticed, that parametrized definitions is not supported (e.g `->weeklyOn(1, '8:00');`) however it fully covered by Cron syntax.

#### `cache.default`

[](#cachedefault)

Stands for caching engine name can be one of `file` or `redis`

#### `log_to` (optional)

[](#log_to-optional)

Relative path to log file where it will log execution output, be aware that log file is not rotated

#### `cache.prefix`

[](#cacheprefix)

Used as prefix to cache entries it creates

#### `cache.stores.file`

[](#cachestoresfile)

Configuration for file cache engine

#### `cache.stores.redis`

[](#cachestoresredis)

Configuration for Redis cache engine

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance45

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Total

3

Last Release

2776d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1092955?v=4)[Andrew Lykov](/maintainers/trig)[@trig](https://github.com/trig)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/trig-laracron/health.svg)

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

###  Alternatives

[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

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

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)

PHPackages © 2026

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