PHPackages                             mhndev/rate - 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. mhndev/rate

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

mhndev/rate
===========

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

1.0.10(8y ago)5751MITPHPPHP &gt;=5.4.0

Since May 18Pushed 8y ago2 watchersCompare

[ Source](https://github.com/mhndev/rate)[ Packagist](https://packagist.org/packages/mhndev/rate)[ RSS](/packages/mhndev-rate/feed)WikiDiscussions develop Synced 2mo ago

READMEChangelogDependencies (2)Versions (11)Used By (1)

Rate System
===========

[](#rate-system)

Supports
--------

[](#supports)

### 1) Like

[](#1-like)

### 2) Like (+1), Dislike(-1)

[](#2-like-1-dislike-1)

### 3) Rate with other number(e.x. 0 &lt; rate &lt;= 5 )

[](#3-rate-with-other-numberex-0--rate--5-)

### 4) Rate with string ('good' , 'very good' , ...)

[](#4-rate-with-string-good--very-good--)

Sample Usage
------------

[](#sample-usage)

```
use mhndev\rate\Abstracts\Entity;
use mhndev\rate\DiscreteNumberValue;
use mhndev\rate\Interfaces\iRateableEntity;

class User
{
    use \mhndev\rate\Traits\UserTrait;

    /**
     * @param $value
     * @param iRateableEntity $entity
     * @param $type
     */
    function doRate($value, iRateableEntity $entity, $type)
    {
        echo 'rate is done in our storage system.';
    }
}

//you can either extend your entity from AbstractEntity class
class Post extends Entity
{

}
//or use EntityTrait in your Entity

class Post implements iRateableEntity
{
    use \mhndev\rate\Traits\EntityTrait;
}

class Comment extends Entity
{

}

//or use EntityTrait in your Entity
class Comment implements iRateableEntity
{
    use \mhndev\rate\Traits\EntityTrait;
}

$rateValue = (new DiscreteNumberValue())->setPossibleValues([1,2,3]);
$post = (new Post())->setRateValue($rateValue);
//or
Post::setRateValue($rateValue);

$post->setPossibleRateTypes(['like', 'rate']);

$rateValue = (new DiscreteNumberValue())->setPossibleValues([-1,1]);
$comment = (new Comment())->setRateValue($rateValue);

//or
Comment::setRateValue($rateValue);
// by default possible rate types are "rate" and "like" so if you want your rate types to be just like default you don't need to call setPossibleRateTypes method on entity pbject

$post->setPossibleRateTypes(['like', 'rate', 'test']);
//or
Post::setPossibleRateTypes(['like', 'rate', 'test']);

$user = new User;

$user->rate(3, $post);
$user->like($post);
$user->rate(1,$comment);
$user->dislike($comment);

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~51 days

Recently: every ~93 days

Total

11

Last Release

3140d ago

Major Versions

0.1.4 → 1.0.52016-09-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c3e5d182214e2e6b989a2230bcae80b2107b088da1c6dbea6f6f8d28702e272?d=identicon)[majidphpdeveloper](/maintainers/majidphpdeveloper)

---

Top Contributors

[![mhndev](https://avatars.githubusercontent.com/u/5164182?v=4)](https://github.com/mhndev "mhndev (9 commits)")

---

Tags

raterating-systemRatelikedislikeUnlikerank

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mhndev-rate/health.svg)

```
[![Health](https://phpackages.com/badges/mhndev-rate/health.svg)](https://phpackages.com/packages/mhndev-rate)
```

###  Alternatives

[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[florianv/swap

Exchange rates library for PHP

1.3k6.4M16](/packages/florianv-swap)[qirolab/laravel-reactions

Implement reactions (like, dislike, love, emotion etc) on Laravel Eloquent models.

19564.6k](/packages/qirolab-laravel-reactions)[florianv/laravel-swap

Currency exchange rates library for Laravel and Lumen

3342.0M2](/packages/florianv-laravel-swap)[bandwidth-throttle/bandwidth-throttle

Bandwidth throttle at application layer

87139.3k](/packages/bandwidth-throttle-bandwidth-throttle)[risul/laravel-like-comment

Ajax based site wide like and comment system for laravel

1116.9k](/packages/risul-laravel-like-comment)

PHPackages © 2026

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