PHPackages                             kosmoskosmos/rating - 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. kosmoskosmos/rating

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

kosmoskosmos/rating
===================

Allows multiple models to be rated with a five-star like system on Laravel Nova

v0.13.1(2y ago)31.7k3[2 issues](https://github.com/KosmosKosmos/nova-rating/issues)MITPHPPHP &gt;=7.3

Since Nov 29Pushed 2y ago5 watchersCompare

[ Source](https://github.com/KosmosKosmos/nova-rating)[ Packagist](https://packagist.org/packages/kosmoskosmos/rating)[ Docs](https://github.com/kosmoskosmos/nova-rating)[ RSS](/packages/kosmoskosmos-rating/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (16)Used By (0)

Laravel Nova Rateable Field Extension
=====================================

[](#laravel-nova-rateable-field-extension)

About
-----

[](#about)

This package introduces a **Rateable Trait** to your application's models on **Laravel Nova**.

This package introduces a **Rateable Trait** to your application's models.

Also, it introduces an interactive **Field** to your Nova backend that makes it possible to instantly rate any property you wish.

With this package it is possible to perform multiple category rating.

For example, you might want to rate the

- Performance
- Price
- Quality

of a product.

However, you can also generate a field that returns the average rating over all three categories combined with the virtual attribute `averageRating`

Config Settings
---------------

[](#config-settings)

Run `php artisan vendor:publish --tag=config` to set default settings. You will find them in `config/rating.php`.

You can also set a specific size and padding per field entry via calling the `starSize` and `padding` methods.

Credits
-------

[](#credits)

Thank you for doing the base work:

#### Special credits

[](#special-credits)

Thank you for inspiring us:

*If you need some more documentation about possible options, this might be a good documentation resource.*

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

[](#installation)

1. `composer require kosmoskosmos/rating`
2. `php artisan vendor:publish`
3. `php artisan migrate`

Usage
-----

[](#usage)

```
public function fields(Request $request)
{
    return [
        // ...
        // Define categories for to be rated.
        Rating::make('Pizza Baking Skills', 'pizza_rating')->hideFromIndex(),
        Rating::make('Sushi Rolling Skills',  'sushi_rating')->hideFromIndex(),
        Rating::make('Bread Baking Skills', 'bread_rating')->hideFromIndex(),
        // Show average rating from all three categories above.
        Rating::make('Overall Skills', 'average_rating')->onlyOnIndex(),
        // Show average rating from only one category above
        Rating::make('Overall Bread Baking Skills', 'bread_average_rating')->onlyOnIndex(),
    ];
}
```

Extend your model like this:

```
class MyModel extends Model {
    // use the Rateable trait
    use \KosmosKosmos\Rating\Rateable;

    // use the getAttribute() function to inject the Trait's attribute-resolver
    public function getAttribute($key) {
        if ($result = $this->resolveRatingAttribute($key)) {
            return $result;
        }
        return parent::getAttribute($key);
    }

}
```

### Attribute Naming Conventions

[](#attribute-naming-conventions)

To make best use of this plugin we advise to use the suffix `_rating` or `Rating` for your rateable fields.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87% 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 ~117 days

Recently: every ~280 days

Total

13

Last Release

938d ago

PHP version history (2 changes)v0.9.1PHP &gt;=7.2

v0.12.1PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ff9eed3eeebfed3c315031f97ea86c1783e023772b4ff759b49a6f269a10d07?d=identicon)[kosmoskosmos](/maintainers/kosmoskosmos)

---

Top Contributors

[![kosmonowt](https://avatars.githubusercontent.com/u/1159594?v=4)](https://github.com/kosmonowt "kosmonowt (20 commits)")[![karlvalentin](https://avatars.githubusercontent.com/u/12029511?v=4)](https://github.com/karlvalentin "karlvalentin (2 commits)")[![KhardungLa](https://avatars.githubusercontent.com/u/5470923?v=4)](https://github.com/KhardungLa "KhardungLa (1 commits)")

---

Tags

laravellaravel 6laravel 7laravel 8laravel 9novaRatingvoterateablefivestar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kosmoskosmos-rating/health.svg)

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

###  Alternatives

[willvincent/laravel-rateable

Allows multiple models to be rated with a fivestar like system.

416452.0k3](/packages/willvincent-laravel-rateable)[ip2location/ip2location-laravel

Lookup for visitor's IP information, such as country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type.

83516.9k1](/packages/ip2location-ip2location-laravel)[efficiently/jquery-laravel

This package provides jQuery and the jQuery-ujs driver for your Laravel &gt;= 6 application.

1311.0k1](/packages/efficiently-jquery-laravel)[itsmurumba/laravel-mpesa

Laravel Package for Mpesa Daraja API

191.6k](/packages/itsmurumba-laravel-mpesa)

PHPackages © 2026

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