PHPackages                             sunlab/wn-updown-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sunlab/wn-updown-plugin

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

sunlab/wn-updown-plugin
=======================

Plugin for WinterCMS that allows your users to up/down-vote any models

221PHP

Since Jul 2Pushed 5y agoCompare

[ Source](https://github.com/SunLabDev/wn-updown-plugin)[ Packagist](https://packagist.org/packages/sunlab/wn-updown-plugin)[ RSS](/packages/sunlab-wn-updown-plugin/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

UpDown
------

[](#updown)

UpDown feature on any model. Easily.

A tiny demo, based on two distinct model: `Winter\Forum\Models\Post` and a custom plugin's Comment model.

    UpDown.-.demo.mp4    ### Composer installation

[](#composer-installation)

```
composer require sunlab/wn-updown-plugin

```

### Requirements

[](#requirements)

This plugin requires the [Winter.User](https://github.com/wintercms/wn-user-plugin) Plugin.

### Usage guide - Example with Winter.Blog `Post` model

[](#usage-guide---example-with-winterblog-post-model)

#### 1. First step, extend the model

[](#1-first-step-extend-the-model)

To use the up/down feature on a model, you need to add the `Votable` behavior to the model(s) you want:

```
class Plugin extends PluginBase
{
    public function boot()
    {
        \Winter\Blog\Models\Post::extend(static function ($post) {
            $post->implement[] = \SunLab\UpDown\Behaviors\Votable::class;
        });
    }
}
```

#### 2. Second step, add the component to the page

[](#2-second-step-add-the-component-to-the-page)

Then, you need to add the `upDown` component on a blog post page or blog post list page:

```
title = "Blog"
url = "/blog/:page?"
layout = "default"
description = "The main blog page, with all posts."
hidden = "0"

[blogPosts]
pageNumber = "{{ :page }}"
postsPerPage = "10"
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = "blog/category"
postPage = "blog/post"

[upDown]
==
{% component 'blogPosts' %}
```

#### 3. Third step, add the same component multiple times

[](#3-third-step-add-the-same-component-multiple-times)

Then, inside the override of the `blogPosts` partial, add the `upDown` component **inside the loop** and use [component's dynamic properties](https://wintercms.com/docs/cms/components#component-variables)to initialize the component with the current post:

```
{# Loop over the blog posts #}
{% for post in posts %}

    {# For each post, displays the upDown component #}
    {% component 'upDown' votable=post %}

    {% partial "blog/post" post=post %}

{% endfor %}
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

### 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 (3 commits)")

### Embed Badge

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

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

###  Alternatives

[fusio/impl

Fusio implementation

1227.6k2](/packages/fusio-impl)[dwenzel/t3events

Versatile events extension for the TYPO3 CMS

1113.2k4](/packages/dwenzel-t3events)[wpmetabox/mb-relationships

A lightweight solution for creating many-to-many posts to posts relationships in WordPress.

291.2k4](/packages/wpmetabox-mb-relationships)

PHPackages © 2026

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