PHPackages                             fimaruf/recurring-task-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. fimaruf/recurring-task-scheduler

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

fimaruf/recurring-task-scheduler
================================

Laravel Recurring Task Scheduler

3.3.0(6y ago)021proprietaryPHP

Since Aug 24Pushed 4y agoCompare

[ Source](https://github.com/fimaruf/package-laravel-recurring-task-scheduler)[ Packagist](https://packagist.org/packages/fimaruf/recurring-task-scheduler)[ RSS](/packages/fimaruf-recurring-task-scheduler/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (8)Versions (85)Used By (0)

Recurring Task Scheduler Package
================================

[](#recurring-task-scheduler-package)

 [![](https://camo.githubusercontent.com/4ba2cc38bb777570479cda11eea1111d6423c938989b0dc1c69e1e6520ef68a3/68747470733a2f2f7472617669732d63692e6f72672f43726f7564537570706f72742f726563757272696e675f7461736b5f7363686564756c65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/CroudSupport/recurring_task_scheduler) [![](https://camo.githubusercontent.com/7711ef2b241471c062b1c13b8a96051ac1146a8c301995a26de0aa0724d17d84/68747470733a2f2f706f7365722e707567782e6f72672f63726f7564746563682f726563757272696e672d7461736b2d7363686564756c65722f762f737461626c65)](https://packagist.org/packages/croudtech/recurring-task-scheduler) [![](https://camo.githubusercontent.com/47ea84c5d7eed2d3d60811d0a5d56a4302a04ff9deef01071a3af3eeb00e2f29/68747470733a2f2f706f7365722e707567782e6f72672f63726f7564746563682f726563757272696e672d7461736b2d7363686564756c65722f762f756e737461626c65)](https://packagist.org/packages/croudtech/recurring-task-scheduler) [![](https://camo.githubusercontent.com/e3b895f67bfa054e9c5062f00e89fde22defb76a6508c3d829c5bf87669f651c/68747470733a2f2f706f7365722e707567782e6f72672f63726f7564746563682f726563757272696e672d7461736b2d7363686564756c65722f636f6d706f7365726c6f636b)](https://packagist.org/packages/croudtech/recurring-task-scheduler) [![](https://camo.githubusercontent.com/6c18a9c5a06d7bb0a0caa732d2050a2fd5e6a58a758ca37b1f89b507887bb4f4/68747470733a2f2f706f7365722e707567782e6f72672f63726f7564746563682f726563757272696e672d7461736b2d7363686564756c65722f6c6963656e7365)](https://packagist.org/packages/croudtech/recurring-task-scheduler) [![](https://camo.githubusercontent.com/718be6401ca480abec6e20d6d9f997276233faf66924d25d3c071fb3ddbfc20d/68747470733a2f2f706f7365722e707567782e6f72672f63726f7564746563682f726563757272696e672d7461736b2d7363686564756c65722f646f776e6c6f616473)](https://packagist.org/packages/croudtech/recurring-task-scheduler)

PHP Laravel Package to provide scheduler functionality.

A SchedulableTrait is provided which allows you to link elqoquent models to a schedule model.

The scheduler generates a collection of future schedule event records and has a command line task that executes the schedule callback on the attached object.

Package Installation
--------------------

[](#package-installation)

composer require croudtech/recurring\_task\_scheduler

Add the schedulable provider to the providers list in your laravel config/app.php file:

```
[
    ...
    'providers' => [
        ...
        \CroudTech\RecurringTaskScheduler\RecurringTaskSchedulerServiceProvider::class,
        ...
    ],
    ...
]
```

A schedulable model must use the `RecurringTaskSchedulableTrait` and implement `RecurringTaskSchedulableInterface`.

The `RecurringTaskSchedulableInterface` interface expects a `recurringTaskScheduleCallback()` method which is called when the schedule is executed.

```
class Task extends Model {
    public function recurringTaskScheduleCallback(\CroudTech\RecurringTaskScheduler\ScheduleEvent $schedule_event) : boolean
    {
        try {
            ...do something here...
            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
}
```

### Routes

[](#routes)

#### api/croudtech/schedule/{schedule}

[](#apicroudtechscheduleschedule)

Restful resource route for schedule objects

#### api/croudtech/schedule/{schedule}/schedule-event/{schedule\_event}

[](#apicroudtechschedulescheduleschedule-eventschedule_event)

Nested resource route for schedule events

#### api/croudtech/schedule/parse

[](#apicroudtechscheduleparse)

Schedule parser. Pass a definition array in to get the matching dates. Doesn't save any data so is useful for previews

### Prerequisites

[](#prerequisites)

PHP 7 and Laravel 5.3^

### Versioning

[](#versioning)

[SemVer](http://semver.org/)

Deployment
----------

[](#deployment)

This package should be installed via composer following the package installation steps above

Owner
-----

[](#owner)

Jim Robinson

Documentation
=============

[](#documentation)

Schedule definition schema
--------------------------

[](#schedule-definition-schema)

- Daily
- - Every N days {period, interval}
- - Every Workday {period, interval, modifier}
- - Every DOW {period, interval}
- Weekly
- - N weeks {period, interval}
- - On DOW {period, interval, modifier}
- Same day each month
- - Day N of every N months {period, interval, modifier}
- Same week each month
- – every N months on the (1,2,3,4,last) DOW {period, interval, modifier}
- Same day each year
- – Day Month {period, interval, modifier}
- Same week each year
- – (1,2,3,4,last) DOW or Month {period, interval, modifier}

```
SELECT Date_format(Now(), '%Y %c %w')
      AS
      current_formatted_day,
      Date_format(Now(), Concat('%Y ', months.month_number, ' ',
                         days.day_number)) AS
      schedule_formatted_day,
      months.month_name,
      months.month_number,
      days.day_name,
      days.day_number,
      schedules.*
FROM   schedules
      INNER JOIN (SELECT id,
                         'January' AS `month_name`,
                         '1'       AS `month_number`
                  FROM   schedules
                  WHERE  `jan` = 1
                  UNION ALL
                  SELECT id,
                         'February' AS `month_name`,
                         '2'        AS `month_number`
                  FROM   schedules
                  WHERE  `feb` = 1
                  UNION ALL
                  SELECT id,
                         'March' AS `month_name`,
                         '3'     AS `month_number`
                  FROM   schedules
                  WHERE  `mar` = 1
                  UNION ALL
                  SELECT id,
                         'April' AS `month_name`,
                         '4'     AS `month_number`
                  FROM   schedules
                  WHERE  `apr` = 1
                  UNION ALL
                  SELECT id,
                         'May' AS `month_name`,
                         '5'   AS `month_number`
                  FROM   schedules
                  WHERE  `may` = 1
                  UNION ALL
                  SELECT id,
                         'June' AS `month_name`,
                         '6'    AS `month_number`
                  FROM   schedules
                  WHERE  `jun` = 1
                  UNION ALL
                  SELECT id,
                         'July' AS `month_name`,
                         '7'    AS `month_number`
                  FROM   schedules
                  WHERE  `jul` = 1
                  UNION ALL
                  SELECT id,
                         'August' AS `month_name`,
                         '8'      AS `month_number`
                  FROM   schedules
                  WHERE  `aug` = 1
                  UNION ALL
                  SELECT id,
                         'September' AS `month_name`,
                         '9'         AS `month_number`
                  FROM   schedules
                  WHERE  `sep` = 1
                  UNION ALL
                  SELECT id,
                         'October' AS `month_name`,
                         '10'      AS `month_number`
                  FROM   schedules
                  WHERE  `oct` = 1
                  UNION ALL
                  SELECT id,
                         'November' AS `month_name`,
                         '11'       AS `month_number`
                  FROM   schedules
                  WHERE  `nov` = 1
                  UNION ALL
                  SELECT id,
                         'December' AS `month_name`,
                         '12'       AS `month_number`
                  FROM   schedules
                  WHERE  `dec` = 1) AS months
              ON months.id = schedules.id
      INNER JOIN (SELECT id,
                         'Sun' `day_name`,
                         '0'   AS `day_number`
                  FROM   schedules
                  WHERE  `sun` = 1
                  UNION ALL
                  SELECT id,
                         'Mon' `day_name`,
                         '1'   AS `day_number`
                  FROM   schedules
                  WHERE  `mon` = 1
                  UNION ALL
                  SELECT id,
                         'Tue' `day_name`,
                         '2'   AS `day_number`
                  FROM   schedules
                  WHERE  `tue` = 1
                  UNION ALL
                  SELECT id,
                         'Wed' `day_name`,
                         '3'   AS `day_number`
                  FROM   schedules
                  WHERE  `wed` = 1
                  UNION ALL
                  SELECT id,
                         'Thu' `day_name`,
                         '4'   AS `day_number`
                  FROM   schedules
                  WHERE  `thu` = 1
                  UNION ALL
                  SELECT id,
                         'Fri' `day_name`,
                         '5'   AS `day_number`
                  FROM   schedules
                  WHERE  `fri` = 1
                  UNION ALL
                  SELECT id,
                         'Sat' `day_name`,
                         '6'   AS `day_number`
                  FROM   schedules
                  WHERE  `sat` = 1) AS days
              ON days.id = schedules.id
WHERE
NOW() BETWEEN schedules.starts_at AND schedules.ends_at
AND Date_format(Now(), '%Y %c %w') = Date_format(Now(),
Concat('%Y ', months.month_number, ' ',
days.day_number))
AND (( schedules.period = 'every'
|| ( `period` = CASE
   WHEN Ceil(Day(
   Str_to_date('2017-07-28',
   '%Y-%m-%d')) / 7) = 1
    THEN
   'first'
   WHEN Ceil(Day(
   Str_to_date('2017-07-28',
   '%Y-%m-%d')) / 7) = 2
    THEN
   'second'
   WHEN Ceil(Day(
   Str_to_date('2017-07-28',
   '%Y-%m-%d')) / 7) = 3
    THEN
   'thrird'
   WHEN Ceil(Day(
   Str_to_date('2017-07-28',
   '%Y-%m-%d')) / 7) = 4
    THEN
   'fourth'
   WHEN Ceil(Day(
   Str_to_date('2017-07-28',
   '%Y-%m-%d')) / 7) = 4
    THEN
   'fifth'
   ELSE 'every'
 end )
 || (schedules.period = 'alternate' AND MOD(DAYOFYEAR(NOW()),2) = MOD(DAYOFYEAR(schedules.starts_at),2)
)))
AND deleted_at IS NULL;
```

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 55.6% 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 ~11 days

Recently: every ~18 days

Total

82

Last Release

2311d ago

Major Versions

1.1.1 → 2.0.02017-10-31

2.0.22 → 3.0.4-rc32018-09-12

2.1 → 3.0.0-alpha2018-09-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/16ffd44c0878205b1bb7cbf37475ff541ee448218ca519405ab9a70bb15ef30d?d=identicon)[fimaruf](/maintainers/fimaruf)

---

Top Contributors

[![jimrobinson-croud](https://avatars.githubusercontent.com/u/20241234?v=4)](https://github.com/jimrobinson-croud "jimrobinson-croud (35 commits)")[![paul-watkins-croud](https://avatars.githubusercontent.com/u/14161025?v=4)](https://github.com/paul-watkins-croud "paul-watkins-croud (17 commits)")[![BrockReece](https://avatars.githubusercontent.com/u/8988409?v=4)](https://github.com/BrockReece "BrockReece (6 commits)")[![matthewerskine](https://avatars.githubusercontent.com/u/7579504?v=4)](https://github.com/matthewerskine "matthewerskine (4 commits)")[![jscrobinson](https://avatars.githubusercontent.com/u/235064?v=4)](https://github.com/jscrobinson "jscrobinson (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fimaruf-recurring-task-scheduler/health.svg)

```
[![Health](https://phpackages.com/badges/fimaruf-recurring-task-scheduler/health.svg)](https://phpackages.com/packages/fimaruf-recurring-task-scheduler)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[mediawiki/semantic-cite

A Semantic MediaWiki extension to manage citation resources.

2310.2k1](/packages/mediawiki-semantic-cite)[winter/wn-seo-plugin

Winter CMS plugin for managing SEO tags

106.3k](/packages/winter-wn-seo-plugin)

PHPackages © 2026

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