PHPackages                             sunlab/wn-gamification-plugin - 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. sunlab/wn-gamification-plugin

ActiveWinter-plugin

sunlab/wn-gamification-plugin
=============================

A Gamification plugin for WinterCMS

v1.0.12(4y ago)16511MITPHPPHP &gt;=7.0

Since May 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/SunLabDev/wn-gamification-plugin)[ Packagist](https://packagist.org/packages/sunlab/wn-gamification-plugin)[ Docs](https://github.com/sunlabdev/wn-gamification-plugin)[ RSS](/packages/sunlab-wn-gamification-plugin/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (1)

Gamification
------------

[](#gamification)

This plugin allows you to reward your members when some actions are made. To increment the statistics, this plugin is using [SunLab.Measures](https://github.com/sunlabdev/wn-measures-plugin)

### How to use

[](#how-to-use)

From the backend, create all the needed badges. A badge need at least, a name.

#### Automatic attachment with [SunLab.Measures](https://github.com/sunlabdev/wn-measures-plugin)

[](#automatic-attachment-with-sunlabmeasures)

When filling measure name and amount needed: the users will automatically receive badges once the measure reach the amount needed. Refer to [SunLab.Measures](https://github.com/sunlabdev/wn-measures-plugin) for measure incrementation.

#### Manually attaching/detaching badge

[](#manually-attachingdetaching-badge)

To attach or detach a badge manually, use `attachBadge` and `detachBadge` method, which accept a badge reference as string (its name), int (its id), or a Badge model.

```
\Winter\User\Models\User::extend(function ($user) {
    Event::listen('winter.user.activate', function($user) {
        $user->attachBadge('Verified User');
    });
});
```

#### Verify badge attachment

[](#verify-badge-attachment)

To simplify badge attachment verification, the plugin include a `hasBadge` method, which accept a badge reference as string (its name), int (its id), or a Badge model.

```
if ($user->haBadge('Verified User')) {
    // User has the 'Verified User' badge
}
```

### Components

[](#components)

This plugin comes with two components:

#### BadgesList

[](#badgeslist)

Displays all the badge that can be rewarded, and the number of members of member who already won it.

#### UserBadges

[](#userbadges)

Displays only the badges that a specific member won. The member could be the one actually logged in, or set by an url parameter.

### Tree view

[](#tree-view)

The `Badge` model implement `SimpleTree`. If you want to display the badges as a tree, use the components' property `tree-displayed` to optimize the database search.

*The default query will load the badges ordered by their measure name and amount needed.*

### Measures reminder

[](#measures-reminder)

[SunLab.Measures](https://github.com/sunlabdev/wn-measures-plugin) is internally used by the plugin to increment some measures when some events are emitted. You can configure the most basic events from the backend using the generic event listener of `Measures`, but for complexes cases, you'll need to manually create the listener from a `Plugin.php` file.

A use case for this could be to give a badge rewarding immediately after the registration, because plugins' events are not supported by `Measures` as of today, we need to create it manually:

```
\Winter\User\Models\User::extend(function ($user) {
    $user->bindEvent('model.afterCreate', function () use ($user) {
        $user->incrementMeasure('registered');
    });
});
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~13 days

Total

3

Last Release

1794d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/13edfd2ca556efd1be6f0191a5b3a760ae4156257907b0138a3c3f9a8870354c?d=identicon)[RomainMazB](/maintainers/RomainMazB)

---

Top Contributors

[![RomainMazB](https://avatars.githubusercontent.com/u/53976837?v=4)](https://github.com/RomainMazB "RomainMazB (24 commits)")[![HitArrowLegend](https://avatars.githubusercontent.com/u/2132234?v=4)](https://github.com/HitArrowLegend "HitArrowLegend (2 commits)")[![Dudy83](https://avatars.githubusercontent.com/u/48801109?v=4)](https://github.com/Dudy83 "Dudy83 (1 commits)")

---

Tags

pluginGamificationwinterwinter cms

### Embed Badge

![Health badge](/badges/sunlab-wn-gamification-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/sunlab-wn-gamification-plugin/health.svg)](https://phpackages.com/packages/sunlab-wn-gamification-plugin)
```

###  Alternatives

[winter/wn-blog-plugin

Blog plugin for Winter CMS

2042.1k3](/packages/winter-wn-blog-plugin)[winter/wn-pages-plugin

Pages plugin for Winter CMS

1353.0k3](/packages/winter-wn-pages-plugin)[winter/wn-user-plugin

User plugin for Winter CMS

1233.5k13](/packages/winter-wn-user-plugin)[winter/wn-sitemap-plugin

Sitemap plugin for Winter CMS

1042.6k1](/packages/winter-wn-sitemap-plugin)

PHPackages © 2026

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