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

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

sefirosweb/laravel-cronjobs
===========================

Package for made and modify easly the cronjob system

v13.0.2(3d ago)2173MITTypeScriptPHP ^8.3CI passing

Since Jan 3Pushed 3d ago1 watchersCompare

[ Source](https://github.com/sefirosweb/laravel-cronjobs)[ Packagist](https://packagist.org/packages/sefirosweb/laravel-cronjobs)[ RSS](/packages/sefirosweb-laravel-cronjobs/feed)WikiDiscussions 13.x Synced 3d ago

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

Laravel Cronjobs
================

[](#laravel-cronjobs)

Database-driven cronjob manager for Laravel. Store jobs in MySQL, schedule each one with its own cron expression, retry/timeout policy, and dispatch them to the queue. Ships with a React admin UI.

Requirements
------------

[](#requirements)

- PHP `^8.3`
- Laravel `^13.0`
- A running `schedule:work` process (so pending jobs get dispatched every minute).
- A queue worker (`queue:work` / `queue:listen`) if you want jobs to actually run off the main process.

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

[](#installation)

```
composer require sefirosweb/laravel-cronjobs:^13.0
```

The service provider auto-registers via Laravel's package discovery.

Run migrations:

```
php artisan migrate
```

This creates the `cronjobs` table with fields for name, description, target controller/method, cron expression, backoff, max tries, timeout, retries, and soft-delete.

Configuration
-------------

[](#configuration)

Publish the config:

```
php artisan vendor:publish --provider="Sefirosweb\LaravelCronjobs\LaravelCronjobsServiceProvider" --tag=config --force
```

Default `config/laravel-cronjobs.php`:

```
return [
    'prefix'     => 'cronjobs',
    'middleware' => 'web',
];
```

> ⚠️ **Security**: the admin UI can dispatch *any* controller/method in your app. **Always** protect it with auth and an ACL check. If you use [`sefirosweb/laravel-access-list`](https://github.com/sefirosweb/laravel-access-list):
>
> ```
> return [
>     'prefix'     => 'cronjobs',
>     'middleware' => ['web', 'auth', 'checkAcl:cronjobs_edit'],
> ];
> ```

Publish the React admin UI assets:

```
php artisan vendor:publish --provider="Sefirosweb\LaravelCronjobs\LaravelCronjobsServiceProvider" --tag=cronjobs-assets --force
```

Admin UI
--------

[](#admin-ui)

Since v13.0.1 the bundled admin UI is a self-contained React 19 + TypeScript + Vite SPA. There are no `react-bootstrap` / `react-crud` / `toastr` dependencies anymore — the bundle is ~115 kB gzipped including self-hosted Geist fonts. Tabs are hash-routed (`#cronjobs`, `#queue`).

Cronjobs listing[![Cronjobs list](docs/screenshots/cronjobs-list.png)](docs/screenshots/cronjobs-list.png)Edit cron expression modal[![Edit cron expression](docs/screenshots/cron-expression-modal.png)](docs/screenshots/cron-expression-modal.png)Run-now confirmation[![Run now confirm](docs/screenshots/execute-confirm.png)](docs/screenshots/execute-confirm.png)The cron-expression modal calls `POST /preview_job` debounced on every keystroke and shows the next 40 firings of the expression, so the admin can validate the schedule before saving. A one-click cheat sheet of common patterns (`* * * * *`, `0 * * * *`, `0 0 * * *`, `0 0 * * 0`, `0 0 1 * *`) is right under the input.

The Disable / Enable toggle is optimistic: the row's `deleted_at` flips in cache immediately so the opacity, the "Desactivado" badge and the action buttons update without flicker, with rollback on error.

The *Activos / Todos / Desactivados* segmented filter at the top of the listing maps directly to `?status=` on `GET /cronjobs/crud`, so the trashed rows are reachable without a SQL detour.

Usage
-----

[](#usage)

### 1. Keep the scheduler running

[](#1-keep-the-scheduler-running)

The service provider registers a `cronjobs:pending` command on Laravel's scheduler to run every minute. You need Laravel's own scheduler process alive:

```
php artisan schedule:work
```

…and a queue worker (recommended):

```
php artisan queue:work
```

### 2. Add and manage cronjobs from the UI

[](#2-add-and-manage-cronjobs-from-the-ui)

Browse to `/cronjobs` (or whatever prefix you configured). For each job you define:

FieldMeaningNameFree text identifier (unique).DescriptionFree text.ControllerFully qualified class, e.g. `App\Http\Controllers\Admin\ReportsController`.FunctionPublic method with no required parameters.Cron expressionStandard [cron syntax](https://en.wikipedia.org/wiki/Cron), e.g. `0 3 * * *`. The UI shows a preview of the next 40 runs.BackoffSeconds to wait before retrying after failure.Max triesNumber of retry attempts before marking the job as failed.TimeoutSeconds before the worker kills the job.### 3. Listen for events

[](#3-listen-for-events)

Each dispatch emits an event that your app can react to:

```
use Sefirosweb\LaravelCronjobs\Events\DispatchCronjobSuccessfully;
use Sefirosweb\LaravelCronjobs\Events\DispatchCronjobError;

Event::listen(DispatchCronjobSuccessfully::class, function ($e) {
    // $e->cronjob
});

Event::listen(DispatchCronjobError::class, function ($e) {
    // $e->cronjob, $e->error
});
```

### 4. Artisan commands

[](#4-artisan-commands)

```
# List all cronjobs (active + trashed)
php artisan cronjobs:list

# Manually run a job by name
php artisan cronjobs:execute "Send invoices"

# Run all currently due jobs (this is what the scheduler calls internally)
php artisan cronjobs:pending
```

Testing
-------

[](#testing)

```
composer install
./vendor/bin/phpunit
```

The suite uses Orchestra Testbench + SQLite `:memory:` and covers controller CRUD, the `DispatchCronjob` job, the `Cronjob` model (soft-deletes, casts), and the Carbon 3 `diffInSeconds` regression fix.

When working from the [laravel-test](https://github.com/sefirosweb/laravel-test) harness with Sail:

```
docker exec -w /var/www/html/packages/laravel-cronjobs laravel-test-laravel.test-1 ./vendor/bin/phpunit
```

Versioning
----------

[](#versioning)

Major versions are aligned with Laravel majors (`12.x`, `11.x`, `9.x` …). See the root [CLAUDE.md](https://github.com/sefirosweb/laravel-test/blob/12.0/CLAUDE.md) of the test harness for the full policy.

License
-------

[](#license)

MIT.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance99

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity73

Established project with proven stability

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

Recently: every ~4 days

Total

21

Last Release

3d ago

Major Versions

1.2.3 → 9.x-dev2025-10-05

9.x-dev → v12.0.02026-04-23

v12.0.3 → v13.0.02026-05-09

PHP version history (2 changes)v12.0.0PHP ^8.2

v13.0.0PHP ^8.3

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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