PHPackages                             beebmx/kirby-scheduler - 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. beebmx/kirby-scheduler

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

beebmx/kirby-scheduler
======================

Scheduler offers a fresh approach to managing scheduled tasks on your server.

1.0.7(6mo ago)16761MITPHPPHP ^8.3CI passing

Since Oct 3Pushed 6mo agoCompare

[ Source](https://github.com/beebmx/kirby-scheduler)[ Packagist](https://packagist.org/packages/beebmx/kirby-scheduler)[ Docs](https://github.com/beebmx/kirby-scheduler)[ GitHub Sponsors](https://github.com/beebmx)[ RSS](/packages/beebmx-kirby-scheduler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (16)Versions (9)Used By (1)

[![Scheduler Logo](/.github/assets/logo.svg?raw=true)](https://github.com/beebmx/kirby-scheduler)

[![Build Status](https://camo.githubusercontent.com/a4c8db482f2f51bf2ac18aa7f46c51d3e538a63d75831a3b6f333a294f5eeb80/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f626565626d782f6b697262792d7363686564756c65722f74657374732e796d6c3f6272616e63683d6d61696e)](https://github.com/beebmx/kirby-scheduler/actions)[![Total Downloads](https://camo.githubusercontent.com/a91fba1497350c934a476adfd0a8d956aedc5cf5434671668f3c5697071ed88d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626565626d782f6b697262792d7363686564756c6572)](https://packagist.org/packages/beebmx/kirby-scheduler)[![Latest Stable Version](https://camo.githubusercontent.com/fb20e7f9f83f3fb39b90f692c7c2d65414f7e2775cf048970a6024b15209dc1a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626565626d782f6b697262792d7363686564756c6572)](https://packagist.org/packages/beebmx/kirby-scheduler)[![License](https://camo.githubusercontent.com/8d615df7f068e348d85389e8f6b2b8f0bbdeaa9261ce13b23b3ef7a774a1bb3b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f626565626d782f6b697262792d7363686564756c6572)](https://packagist.org/packages/beebmx/kirby-scheduler)

Scheduler for Kirby
===================

[](#scheduler-for-kirby)

This package enables [Laravel Scheduler](https://laravel.com/docs/scheduling) for your own Kirby applications.

According to `Laravel Scheduler` documentation, `Scheduler` offers a fresh approach to managing scheduled tasks on your server. The scheduler allows you to fluently and expressively define your task schedule within your application itself. When using the scheduler, only a **single cron entry** is needed on your server.

[![Scheduler](/.github/assets/banner.jpg)](/.github/assets/banner.jpg)

---

Overview
--------

[](#overview)

- [1. Installation](#installation)
- [2. Usage](#usage)
- [3. Defining Schedules](#defining-schedules)
- [4. Running the Scheduler](#running-the-scheduler)
- [5. Scheduling Commands](#scheduling-commands)
- [6. Hooks](#hooks)
- [7. Options](#options)
- [8. License](#license)
- [9. Credits](#credits)

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

[](#installation)

```
composer require beebmx/kirby-scheduler

```

Important

There's no support for downloading the plugin manually. Please use Composer to install it.

Since `Scheduler` depends on `Laravel Scheduler`, and it uses some helpers from `Illuminate/Support`, you need to deactivate some helpers globally in your `index.php` file:

```
/*
 * In your index.php file, and before rendering Kirby, add the following lines.
 */
const KIRBY_HELPER_E = false;
```

Note

You can check the Kirby [documentation](https://getkirby.com/docs/reference/templates/helpers#deactivate-a-helper-globally) for more information about helpers.

Usage
-----

[](#usage)

With Kirby `Scheduler` you have two ways to create your scheduled tasks:

### Closure

[](#closure)

This is the easiest way to create your scheduled tasks. You can define your scheduled tasks using a `closure` in the `config.php` file.

```
use Beebmx\KirbScheduler\Schedule;

'beebmx.scheduler' => [
    'schedule' => function (Schedule $schedule) {
        $schedule->call(function() {
            //
        })->daily();
    },
],
```

### File tasks

[](#file-tasks)

If you have many scheduled tasks, you can create a dedicated file to manage them. You can define the location of the file in your `config.php`:

```
use Beebmx\KirbScheduler\Facades\Schedule;

'beebmx.scheduler' => [
    'tasks' => __DIR__.'/tasks.php'
],
```

Note

You can define the filename and location as you wish; just make sure to provide the correct path.

Then, in the `tasks.php` file, you can define your scheduled tasks:

```
