PHPackages                             codebyray/laravel-review-rateable - 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. codebyray/laravel-review-rateable

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

codebyray/laravel-review-rateable
=================================

Review &amp; Rating system for Laravel 10, 11 &amp; 12

v2.1.1(6mo ago)309356.9k↑11.4%56[2 PRs](https://github.com/codebyray/laravel-review-rateable/pulls)MITPHPPHP &gt;=8.1

Since Oct 26Pushed 6mo ago3 watchersCompare

[ Source](https://github.com/codebyray/laravel-review-rateable)[ Packagist](https://packagist.org/packages/codebyray/laravel-review-rateable)[ GitHub Sponsors](https://github.com/codebyray)[ RSS](/packages/codebyray-laravel-review-rateable/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (5)Versions (19)Used By (0)

Laravel Review Rateable
=======================

[](#laravel-review-rateable)

[![Packagist Downloads](https://camo.githubusercontent.com/59c320089b529072f34529d9af5be10dc2aac89afd9f2ac2224f7c8a80dfefaf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f646562797261792f6c61726176656c2d7265766965772d7261746561626c65)](https://camo.githubusercontent.com/59c320089b529072f34529d9af5be10dc2aac89afd9f2ac2224f7c8a80dfefaf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f646562797261792f6c61726176656c2d7265766965772d7261746561626c65) [![GitHub](https://camo.githubusercontent.com/31d25dc3334f395b6f7f4b9c7b5e45ad94af9f9c2bcf347be2af3d6db1609249/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f646562797261792f6c61726176656c2d7265766965772d7261746561626c65)](https://camo.githubusercontent.com/31d25dc3334f395b6f7f4b9c7b5e45ad94af9f9c2bcf347be2af3d6db1609249/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f646562797261792f6c61726176656c2d7265766965772d7261746561626c65) [![GitHub release (latest SemVer)](https://camo.githubusercontent.com/a05d9882a558c021b5bdf98cb04de9215fde65f5bf1930c785a1fd05fdc224d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f636f646562797261792f6c61726176656c2d7265766965772d7261746561626c65)](https://camo.githubusercontent.com/a05d9882a558c021b5bdf98cb04de9215fde65f5bf1930c785a1fd05fdc224d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f636f646562797261792f6c61726176656c2d7265766965772d7261746561626c65) [![TravisCI](https://camo.githubusercontent.com/a477654b14f8482aee11be27337452789058aedd0683c6525b4a6d8292724471/68747470733a2f2f6170692e7472617669732d63692e636f6d2f636f646562797261792f6c61726176656c2d7265766965772d7261746561626c652e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/a477654b14f8482aee11be27337452789058aedd0683c6525b4a6d8292724471/68747470733a2f2f6170692e7472617669732d63692e636f6d2f636f646562797261792f6c61726176656c2d7265766965772d7261746561626c652e7376673f6272616e63683d6d6173746572)

NOTE: This is a complete rewrite from v1. It is not compatible with previous versions of this package.

Laravel Review Ratable is a flexible package that enables you to attach reviews (with multiple ratings) to any Eloquent model in your Laravel application. The package supports multiple departments, configurable rating boundaries, review approval, and a decoupled service contract so you can easily integrate, test, and extend the functionality.

Features
--------

[](#features)

- **Reviews &amp; Ratings:** Attach written reviews along with multiple rating values to any model.
- **Configurable Settings:** Define custom rating keys, labels, and value boundaries (min/max) via a config file.
- **Department Support:** Organize ratings by department (e.g. default, sales, support) with their own criteria.
- **Review Approval:** Set a default approval status for reviews (and override per review if needed).
- **Flexible Data Retrieval:** Retrieve reviews with or without ratings, filter by approval status, and calculate averages.
- **Service Contract:** Use a dedicated service that implements a contract for a decoupled, testable API.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10, 11, or 12

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

In your Laravel application's root, require the package via Composer.

```
composer require codebyray/laravel-review-rateable:^2.0

```

### 2. Publish Package Assets

[](#2-publish-package-assets)

After installation, publish the package config and migration files:

```
php artisan vendor:publish --provider="Codebyray\ReviewRateable\ReviewRateableServiceProvider" --tag=config
```

```
php artisan vendor:publish --provider="Codebyray\ReviewRateable\ReviewRateableServiceProvider" --tag=migrations
```

Run the migrations to create the necessary database tables:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

The package configuration file is located at config/review-ratable.php. Here you can adjust global settings such as:

- Rating Value Boundaries:
    - min\_rating\_value: Minimum rating value.
    - max\_rating\_value: Maximum rating value.
- Review Approval:
    - review\_approved: Default approval status for new reviews.
- Departments &amp; Rating Labels: Define multiple departments, each with its own set of rating keys and labels.

### Example configuration:

[](#example-configuration)

```
