PHPackages                             jobmetric/laravel-star - 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. jobmetric/laravel-star

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

jobmetric/laravel-star
======================

This is a star rating management package for any object in Laravel that you can use in your projects.

2.2.0(4mo ago)74591MITPHPPHP &gt;=8.0.1CI passing

Since May 15Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/jobmetric/laravel-star)[ Packagist](https://packagist.org/packages/jobmetric/laravel-star)[ Docs](https://doc.jobmetric.net/package/laravel-star)[ RSS](/packages/jobmetric-laravel-star/feed)WikiDiscussions master Synced 1mo ago

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

[![Contributors](https://camo.githubusercontent.com/b8d146b286cc28d4e25f84a9a3a444e17fa703b43e182bc513d626946d419130/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6a6f626d65747269632f6c61726176656c2d737461722e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-star/graphs/contributors)[![Forks](https://camo.githubusercontent.com/b6b040bf7122f7255a57f1d089435bb739cb0b3be17dd7772e74fe1f1219e753/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6a6f626d65747269632f6c61726176656c2d737461722e7376673f7374796c653d666f722d7468652d6261646765266c6162656c3d466f726b)](https://github.com/jobmetric/laravel-star/network/members)[![Stargazers](https://camo.githubusercontent.com/9a0c3acc9577681fff9e7f6c9825243b3d2f51d957d6ba641f614a0ca42beaaa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6a6f626d65747269632f6c61726176656c2d737461722e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-star/stargazers)[![MIT License](https://camo.githubusercontent.com/fb9cbe35979b17b9afa9c943e6ba59a774b97b2eba0e51fe6443109cb739fa43/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6f626d65747269632f6c61726176656c2d737461722e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-star/blob/master/LICENCE.md)[![LinkedIn](https://camo.githubusercontent.com/eb590f47a3fca74584d18db8dd3e985ae3d786f50cd41b7530c3af3885da233c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d4c696e6b6564496e2d626c75652e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d6c696e6b6564696e26636f6c6f72423d353535)](https://linkedin.com/in/majidmohammadian)

Laravel Star
============

[](#laravel-star)

**Build Star Ratings. Simply and Powerfully.**

Laravel Star simplifies star rating management in Laravel applications. Stop creating separate tables for each rating type and start building rating systems with confidence. It provides a modern, flexible package that allows your Eloquent models to handle star rating functionality (e.g., 1 to 5 stars)—perfect for building e-commerce product ratings, review systems, and content quality assessment. This is where powerful rating management meets developer-friendly simplicity—giving you complete control over star ratings without the complexity.

Why Laravel Star?
-----------------

[](#why-laravel-star)

### Simple API

[](#simple-api)

Laravel Star provides a clean, intuitive API for managing star ratings. Add, update, remove, and query ratings with simple method calls—no complex queries or manual relationship management.

### Flexible Rating Scale

[](#flexible-rating-scale)

Support any rating scale you need: 1-5 stars, 0-10, or any custom range. The package is fully configurable to match your application's requirements.

### Anonymous Ratings

[](#anonymous-ratings)

Support both authenticated user ratings and anonymous device-based ratings. Perfect for applications where users can rate without logging in, or where you need to track ratings by device.

### Polymorphic Relationships

[](#polymorphic-relationships)

Use star ratings on any Eloquent model through polymorphic relationships. Products, articles, reviews, services—anything can be starable, and any model can be a starrer.

What is Star Rating Management?
-------------------------------

[](#what-is-star-rating-management)

Star rating management is the process of allowing users or devices to rate content using a numeric scale (typically 1-5 stars). Traditional approaches often involve:

- Creating separate tables for each rating type
- Writing complex queries to calculate averages
- Managing rating state manually
- Duplicating code across different models

Laravel Star solves these challenges by providing:

- **Unified System**: Single table for all star ratings
- **Polymorphic Design**: Works with any model
- **Simple API**: Clean methods for all operations
- **Event Integration**: Built-in events for extensibility
- **Query Helpers**: Easy methods for common queries

Consider an e-commerce platform where customers can rate products from 1 to 5 stars. With Laravel Star, you can add ratings programmatically, calculate average ratings automatically, get rating distributions, track ratings by user or device, and integrate with notification systems through events. The power of star rating management lies not only in flexible rating scales but also in making it easy to query, track, and manage throughout your application.

What Awaits You?
----------------

[](#what-awaits-you)

By adopting Laravel Star, you will:

- **Build rating systems** - Add star ratings to products, articles, and any content
- **Simplify rating management** - Single API for all rating operations
- **Support anonymous users** - Track ratings by device without authentication
- **Improve user trust** - Display average ratings and rating distributions
- **Enable flexible scales** - Use any rating scale that fits your needs
- **Maintain clean code** - Simple, intuitive API that follows Laravel conventions

Quick Start
-----------

[](#quick-start)

Install Laravel Star via Composer:

```
composer require jobmetric/laravel-star
```

Then publish the migration and run it:

```
php artisan vendor:publish --tag=star-migrations
php artisan migrate
```

Documentation
-------------

[](#documentation)

Ready to transform your Laravel applications? Our comprehensive documentation is your gateway to mastering Laravel Star:

**[📚 Read Full Documentation →](https://jobmetric.github.io/packages/laravel-star/)**

The documentation includes:

- **Getting Started** - Quick introduction and installation guide
- **HasStar** - Trait for models that can receive star ratings
- **CanStar** - Trait for models that can give star ratings
- **Star Model** - Eloquent model for storing star ratings
- **Events** - Hook into rating lifecycle
- **Querying** - Methods for counting, averaging, and summarizing ratings
- **Real-World Examples** - See how it works in practice

Contributing
------------

[](#contributing)

Thank you for participating in `laravel-star`. A contribution guide can be found [here](CONTRIBUTING.md).

License
-------

[](#license)

The `laravel-star` is open-sourced software licensed under the MIT license. See [License File](LICENCE.md) for more information.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance76

Regular maintenance activity

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.1% 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 ~74 days

Recently: every ~141 days

Total

9

Last Release

134d ago

Major Versions

1.1.3 → 2.0.02025-08-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/b00d08bd4b0b765ee2d33719a535e6cb49c04fb945078a0809d5c05e6f16ee96?d=identicon)[majidmohammadian](/maintainers/majidmohammadian)

---

Top Contributors

[![MajidMohammadian](https://avatars.githubusercontent.com/u/2099965?v=4)](https://github.com/MajidMohammadian "MajidMohammadian (40 commits)")[![Bagheri-Matin](https://avatars.githubusercontent.com/u/239607447?v=4)](https://github.com/Bagheri-Matin "Bagheri-Matin (5 commits)")[![hassan7303](https://avatars.githubusercontent.com/u/128932029?v=4)](https://github.com/hassan7303 "hassan7303 (2 commits)")

---

Tags

laravellaravel-packagelaravel-starstarstarablelaravelpackagemanagementstarjobmetric

### Embed Badge

![Health badge](/badges/jobmetric-laravel-star/health.svg)

```
[![Health](https://phpackages.com/badges/jobmetric-laravel-star/health.svg)](https://phpackages.com/packages/jobmetric-laravel-star)
```

###  Alternatives

[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[cybercog/laravel-paket

Composer personal web interface. Manage Laravel dependencies without switching to command line!

1753.3k](/packages/cybercog-laravel-paket)

PHPackages © 2026

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