PHPackages                             pauloamgomes/cockpitcms-moderation - 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. pauloamgomes/cockpitcms-moderation

AbandonedArchivedCockpit-module

pauloamgomes/cockpitcms-moderation
==================================

Moderation addon for Cockpit CMS, provides status capabilities (Unpublished, Draft or Published) for collections

2406[2 issues](https://github.com/pauloamgomes/CockpitCMS-Moderation/issues)[1 PRs](https://github.com/pauloamgomes/CockpitCMS-Moderation/pulls)Hack

Since Nov 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/pauloamgomes/CockpitCMS-Moderation)[ Packagist](https://packagist.org/packages/pauloamgomes/cockpitcms-moderation)[ RSS](/packages/pauloamgomes-cockpitcms-moderation/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)DependenciesVersions (1)Used By (0)

Cockpit CMS Moderation Add-on
=============================

[](#cockpit-cms-moderation-add-on)

This addon extends Cockpit CMS core functionality by introducing the possibility to have moderation of collections. It means that its possible to create collections with a status (Unpublished, Draft or Published) affecting the way that entries are retrieved:

- **Unpublished** - Any collection entry in unpublished state will be filtered out.
- **Draft** - Any collection entry in Draft that doesn't have a previous revision in published status will be also filtered out. If there is a previous revision with published status the revision will be returned instead. However on a scenario that we have a published &gt; unpublished &gt; draft sequence no entry will be returned.
- **Published** - They are always returned.

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

[](#installation)

### Manual

[](#manual)

Download [latest release](https://github.com/pauloamgomes/CockpitCMS-Moderation) and extract to `COCKPIT_PATH/addons/Moderation` directory

### Git

[](#git)

```
git clone https://github.com/pauloamgomes/CockpitCMS-Moderation.git ./addons/Moderation
```

### Cockpit CLI

[](#cockpit-cli)

```
php ./cp install/addon --name Moderation --url https://github.com/pauloamgomes/CockpitCMS-Moderation.git
```

### Composer

[](#composer)

1. Make sure path to cockpit addons is defined in your projects' *composer.json* file:

```
{
    "name": "MY_PROJECT",
    "extra": {
        "installer-paths": {
            "cockpit/addons/{$name}": ["type:cockpit-module"]
        }
    }
}
```

2. In your project root run:

```
composer require pauloamgomes/cockpitcms-moderation
```

---

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

[](#configuration)

To use the main functionality of the addon no extra configuration is required. To use the preview mode (Draft entries will be also returned) is required to configure an API key on the addon settings page. You can use the moderation api key in your requests like:

```
http://your-cockpit-site/api/collections/get/?token=&previewToken=

```

Additional addon settings are available at:

### Permissions

[](#permissions)

The following permissions (ACL's) are defined:

- **manage** - access to all moderation states and addons settings page
- **publish** - can change entries to Published state
- **unpublish** - can change entries to Unpublished state

Example of configuration for 3 groups of editors where `editor` can only create/update entries to `Draft` state, `approver` can create/update `Draft` and move to `Published` state, and finally `manager` can publish and unpublish entries.

```
groups:
  editor:
  approver:
    moderation:
      publish: true
  manager:
    moderation:
      publish: true
      unpublish: true
```

By default admins have super access, any other groups that have not the permissions specificed in the configuration, can only create/edit entries only in Draft mode.

### Scheduling

[](#scheduling)

Scheduling is supported since version v1.3, to enable scheduling add a new entry in the config.yml like below:

```
moderation:
  schedule:
    - page
    - article
```

above configuration enables scheduling on collections page and article, if you want to enable for all collections by default use:

```
moderation:
  schedule: *
```

If using scheduling, its required to provide a `schedule` permission for non admin roles:

```
groups:
  editor:
    moderation:
      schedule: true
```

The Scheduling just defines in Cockpit the operation and date/time for a specific collection entry, to run the scheduling is required to invoke a REST API endpoint, that endpoing can be invoked using cron or other mechanism. By default when executed, it will run against all scheduled entries between a range of time in the past (default of 10m, but can be changed in the request) and current date.

The following example illustrates how that works:

[![Scheduling example](https://camo.githubusercontent.com/f187e937d92b474d7bb1b07a86fb8cb69d8c3db0efc7579306b8299ddce9a452/68747470733a2f2f6d6f6e6f736e61702e636f6d2f696d6167652f36737a426d786f5555555a774f375154356b663578565974656f396e3343)](https://camo.githubusercontent.com/f187e937d92b474d7bb1b07a86fb8cb69d8c3db0efc7579306b8299ddce9a452/68747470733a2f2f6d6f6e6f736e61702e636f6d2f696d6167652f36737a426d786f5555555a774f375154356b663578565974656f396e3343)

In the above example, the schedule operation was executed at 22:55 and detected 2 operations to run at 22:52 (in the range of 10m) performing the defined moderation status change.

Usage
-----

[](#usage)

1. Add a new field to your collection of type Moderation. You can name whatever you want for your moderation field, e.g. status, moderation, etc.. But you need to keep in mind if you change the field later you may need to manually update all existing collection entries.
2. When creating a new collection entry the moderation value will be `Draft`, can be changed to `Unpublished` or `Published`.
3. When editing an existing collection the moderation value will change automatically to `Draft`.
4. When retrieving a collection entry (or list of entries) only entries with moderation value of `Published` or `Draft` (if there is a `Published` revision before the `Draft` one) will be returned.

### Options

[](#options)

The moderation field supports the following options:

- `autodraft` (default: *true*) If set to *false*, entries that are being edited wont be set to `Draft`

### Localization

[](#localization)

The moderation fields supports localization as any other Cockpit field, just enable the localization option in the field configuration. When editing an entry, the moderation status will be saved according to the selected option on each language.

If Scheduling is enabled and the moderation field is set to be localized, the scheduling will be defined for each language.

Demo
----

[](#demo)

[![Screencast](https://camo.githubusercontent.com/ab199003b4a806d369f1abf7accf227be628efd778de6a89bc0fe87987f76b75/68747470733a2f2f6d6f6e6f736e61702e636f6d2f696d6167652f6f39463357696848334e744f6b315666737a415253613430327344313255)](http://www.youtube.com/watch?v=TdhoThghRRY "Screencast")

- [Demo v1.3](http://www.youtube.com/watch?v=TdhoThghRRY "Screencast v1.3")
- [Demo v1.0](https://youtu.be/LywGxJqUJkg "Screencast v1.0")

Copyright and license
---------------------

[](#copyright-and-license)

Copyright since 2018 pauloamgomes under the MIT license.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 61.5% 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/e5d76b00c52f0e92746848bda311bf68308c6ecfb1207871504c9814cde6d9b5?d=identicon)[pauloamgomes](/maintainers/pauloamgomes)

---

Top Contributors

[![pauloamgomes](https://avatars.githubusercontent.com/u/102261?v=4)](https://github.com/pauloamgomes "pauloamgomes (24 commits)")[![flommy](https://avatars.githubusercontent.com/u/1256854?v=4)](https://github.com/flommy "flommy (9 commits)")[![gryphonmyers](https://avatars.githubusercontent.com/u/5785304?v=4)](https://github.com/gryphonmyers "gryphonmyers (5 commits)")[![Raruto](https://avatars.githubusercontent.com/u/9614886?v=4)](https://github.com/Raruto "Raruto (1 commits)")

---

Tags

cockpit-cmscockpit-cms-addoncockpitcmsdraftdraft-modemoderationmoderation-addonmoderation-fieldrevision

### Embed Badge

![Health badge](/badges/pauloamgomes-cockpitcms-moderation/health.svg)

```
[![Health](https://phpackages.com/badges/pauloamgomes-cockpitcms-moderation/health.svg)](https://phpackages.com/packages/pauloamgomes-cockpitcms-moderation)
```

PHPackages © 2026

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