PHPackages                             juanchosl/cronjobs - 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. juanchosl/cronjobs

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

juanchosl/cronjobs
==================

Little methods collection in order to create and automated execution of commands as cronjobs

18PHP

Since Jul 29Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/JuanchoSL/Cronjobs)[ Packagist](https://packagist.org/packages/juanchosl/cronjobs)[ RSS](/packages/juanchosl-cronjobs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Cronjobs
========

[](#cronjobs)

Description
-----------

[](#description)

Little methods collection in order to declare some Command as Cronjobs and execute it when the programm time have a coincidence. This is an extension of the [Terminal library](https://github.com/JuanchoSL/Terminal).

Install
-------

[](#install)

```
composer require juanchosl/cronjobs
```

How to use
----------

[](#how-to-use)

### Config

[](#config)

#### Commands

[](#commands)

First, you need to create the desired Command to execute. Visit the Terminal library for show how create [Commands](https://github.com/JuanchoSL/Terminal). The commands can be reused from your own terminal app.

#### Inputs

[](#inputs)

The commands receive the arguments from console, for this reason you need to create an Input entity for declare manually the values to send to the cronjob

```
$input = new Input;
$input->addArgument('required_single', 'value');
$input->addArgument('required_void', null);
$input->addArgument('required_multi', ['a', 'b', 'c']);
```

#### Programming

[](#programming)

In order to set the execution time, needs to create a standard time config using a ProgrammingInterface for declare when the Cronjobs need to be executed You can use the cron standar syntax, the \* value is the default value when it is not setted:

```
$programming = (new Programming)->setHour('*/2');
```

```
$programming = (new Programming)->setHour('15,30,45,0');
```

```
$programming = (new Programming)->setHour('6');
```

### Crontab

[](#crontab)

Create the script to call from your crontab console app every minute (or when you wont) and mount a Crontab app, adding your cronjobs

```
include dirname(__DIR__, 1) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

$logger = new Logger((new FileRepository(LOGS_DIR . DIRECTORY_SEPARATOR . 'cronjobs.log'))->setComposer(new TextComposer));

$app = new Crontab;
$app->setLogger($logger);
$app->setDebug(true);
$app->add(new FirstCommand, (new Input)->addArgument('argument', 'value'), (new Programming)->setHour('*/2')); //Execute every hours multiple of 2
$app->add(new SecondCommand, (new Input)->addArgument('argument', 'value'), (new Programming)->setDayOfWeek(0)); //Execute the first day of week, 0 is Sunday
$app->add(new ThirdCommand, (new Input)->addArgument('argument', 'value'), (new Programming)->setDayOfMonth(1)); //Execute the first day of month
$app->run();
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance41

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/juanchosl-cronjobs/health.svg)

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

###  Alternatives

[mischasigtermans/laravel-altitude

Claude Code agents for the TALL stack, powered by Laravel Boost

1139.2k](/packages/mischasigtermans-laravel-altitude)[bolt/newswidget

📰 A simple Widget Extension to display the latest Bolt news on the dashboard.

13170.5k3](/packages/bolt-newswidget)

PHPackages © 2026

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