PHPackages                             oi-lab/oi-laravel-reviews - 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. oi-lab/oi-laravel-reviews

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

oi-lab/oi-laravel-reviews
=========================

Website and polymorphic model reviews for Laravel: configurable weighted criteria, a single rating grid, moderation, official replies and settings-driven notification emails.

v1.0.0(1mo ago)00MITPHP ^8.2

Since Jul 6Compare

[ Source](https://github.com/oi-lab/oi-laravel-reviews)[ Packagist](https://packagist.org/packages/oi-lab/oi-laravel-reviews)[ RSS](/packages/oi-lab-oi-laravel-reviews/feed)WikiDiscussions Synced 1w ago

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

[![OI Laravel Reviews](./assets/github-preview.png)](./assets/github-preview.png)

OI Laravel Reviews
==================

[](#oi-laravel-reviews)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8d96ed55498b6198e5bae8e659484d156dc4144b0110161a72b6b42fcd91a1b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f692d6c61622f6f692d6c61726176656c2d726576696577732e737667)](https://packagist.org/packages/oi-lab/oi-laravel-reviews)[![Total Downloads](https://camo.githubusercontent.com/19285df8a2d9ff01524959a5f9bf6481ca7d644dfcdf6ae2d18a2633c27b6127/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f692d6c61622f6f692d6c61726176656c2d726576696577732e737667)](https://packagist.org/packages/oi-lab/oi-laravel-reviews)[![Tests](https://camo.githubusercontent.com/6fdd19dd15f708260696fd757a7b728d0d43a984014b10e01bd1d21af5ac5679/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f692d6c61622f6f692d6c61726176656c2d726576696577732f74657374732e796d6c3f6c6162656c3d7465737473)](https://github.com/oi-lab/oi-laravel-reviews/actions)[![License](https://camo.githubusercontent.com/b091d2d39d51deadfe0cddf31e2b2c41ad2852ec7aa4ba82b97795cef0638414/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f692d6c61622f6f692d6c61726176656c2d72657669657773)](LICENSE)

Reviews for Laravel — for the website itself and for any of your models. Collect a single rating or a set of coefficient-weighted criteria on one shared grid (0–5, 0–10, whatever you configure), moderate submissions, publish an official reply to the reviews that are not in your favour, and send confirmation, thank-you and reply emails whose copy is stored in [oi-lab/oi-laravel-settings](https://github.com/oi-lab/oi-laravel-settings) so it stays editable at runtime.

Features
--------

[](#features)

- Two review models: `ReviewWebsite` for the site, `ReviewEntry` for any polymorphic `reviewable` model (restricted to a configurable allow-list).
- A single evaluation **grid** shared by every review and every criterion — switch it from `/5` to `/10` in config.
- **Criteria defined in config** (title, description, coefficient); the overall rating is the coefficient-weighted average of the per-criterion scores, or a single direct rating when no criteria are declared.
- Guest or authenticated authors, with per-scope moderation (`pending → approved / rejected`) and an `auto_approve` shortcut.
- One official `ReviewReply` per review, moderated on the same scale.
- Lifecycle emails (`confirmation`, `thank_you`, `reply`) rendered from `mail`-typed settings, personalised with `:placeholders`, optionally queued.
- Typed [spatie/laravel-data](https://spatie.be/docs/laravel-data) DTOs for every model, config-gated JSON routes, form requests, services and a `Reviews` facade.
- Lifecycle events (`ReviewSubmitted`, `ReviewApproved`, `ReviewReplied`) and fully swappable models resolved through a static resolver.

How It Works
------------

[](#how-it-works)

A review is scored on one grid. Leave `criteria` empty and a review is just an overall `rating`. Declare criteria and each is scored individually — the package stores a `ReviewRating` row per criterion and writes the coefficient-weighted average into the review's `rating` column, so listings and averages stay a single indexed number. `ReviewWebsite` and `ReviewEntry` share the same behaviour; only `ReviewEntry` adds the polymorphic `reviewable` link. Every ratings row and the single `ReviewReply` attach to their review polymorphically, so both review types reuse them.

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

[](#requirements)

- PHP 8.2+
- Laravel 11, 12, or 13
- [spatie/laravel-data](https://spatie.be/docs/laravel-data) 4.23+
- [oi-lab/oi-laravel-settings](https://github.com/oi-lab/oi-laravel-settings) 1.0+ (mail templates)

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

[](#installation)

```
composer require oi-lab/oi-laravel-reviews
```

### Publish &amp; Migrate

[](#publish--migrate)

```
php artisan vendor:publish --tag=oi-laravel-reviews-config
php artisan vendor:publish --tag=oi-laravel-reviews-migrations
php artisan migrate

# seed the notification mail templates into the settings store
php artisan reviews:install-settings
```

Optionally publish the email view to restyle it:

```
php artisan vendor:publish --tag=oi-laravel-reviews-views
```

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

[](#configuration)

`config/oi-laravel-reviews.php` (excerpt):

```
'grid' => [
    'min' => 0,
    'max' => 5,      // set to 10 for a /10 grid
    'step' => 0.5,   // null to allow any value in range
],

'moderation' => [
    'auto_approve' => false,
],

// Models a ReviewEntry may target, keyed by the alias used in requests
'reviewable_models' => [
    'product' => \App\Models\Product::class,
],

// Criteria are config, not database rows. Empty = a single overall rating.
'criteria' => [
    'website' => [
        'design'  => ['title' => 'Design',  'description' => '', 'coefficient' => 1],
        'support' => ['title' => 'Support', 'description' => '', 'coefficient' => 2],
    ],
    'entries' => [
        'default' => [
            'value' => ['title' => 'Value for money', 'description' => '', 'coefficient' => 1],
        ],
        'product' => [
            'taste' => ['title' => 'Taste', 'description' => '', 'coefficient' => 2],
        ],
    ],
],

'notifications' => [
    'enabled' => true,
    'queue' => true,
    'settings' => [
        'confirmation' => 'reviews.mail.confirmation',
        'thank_you' => 'reviews.mail.thank_you',
        'reply' => 'reviews.mail.reply',
    ],
],
```

Usage
-----

[](#usage)

### Submit a website review

[](#submit-a-website-review)

```
use OiLab\OiLaravelReviews\Facades\Reviews;

$review = Reviews::submitWebsiteReview([
    'rating' => 4.5,
    'title' => 'A pleasure to use',
    'body' => 'Fast and clear.',
    'author_name' => 'Jo',
    'author_email' => 'jo@example.com',
]);
```

### Submit a review of one of your models (with criteria)

[](#submit-a-review-of-one-of-your-models-with-criteria)

```
$review = Reviews::submitEntryReview(
    'product',            // reviewable alias from config
    $product->id,
    ['author_name' => 'Jo', 'author_email' => 'jo@example.com'],
    ['taste' => 4, 'value' => 5],   // criterion key => score
);

$review->rating; // coefficient-weighted average of the criteria
```

Pass an authenticated user as the last argument to record them as the author instead of a guest:

```
Reviews::submitWebsiteReview(['rating' => 5], [], $request->user());
```

### Moderate and reply

[](#moderate-and-reply)

```
Reviews::approve($review);   // publishes it and emails a thank-you
Reviews::reject($review);

use OiLab\OiLaravelReviews\Services\ReviewReplyService;

app(ReviewReplyService::class)->reply($review, [
    'body' => 'Thanks for the feedback — here is what happened.',
    'author_name' => 'Support',
]);
```

### JSON endpoints

[](#json-endpoints)

Loaded under `route.prefix` (default `reviews`) when `route.enabled` is true:

Method &amp; URIPurpose`GET  reviews/website`Approved website reviews + summary (count, average)`POST reviews/website`Submit a website review`GET  reviews/entries?reviewable_type=&reviewable_id=`Approved reviews for a model`POST reviews/entries`Submit an entry review`POST reviews/website/{uuid}/reply`Reply to a website review`POST reviews/entries/{uuid}/reply`Reply to an entry reviewThe reply routes honour the optional `route.gate`.

Events
------

[](#events)

Listen instead of overriding internals:

- `OiLab\OiLaravelReviews\Events\ReviewSubmitted`
- `OiLab\OiLaravelReviews\Events\ReviewApproved`
- `OiLab\OiLaravelReviews\Events\ReviewReplied`

Notification Emails
-------------------

[](#notification-emails)

Each lifecycle email resolves a `MailContent` from a `mail`-typed setting in `oi-lab/oi-laravel-settings`, falling back to `notifications.defaults` when the setting is unset. `reviews:install-settings` seeds those settings; edit them at runtime to change the copy. Placeholders (`:author`, `:title`, `:rating`, `:reply`) are substituted per message, and delivery is queued when `notifications.queue` is true.

Customizing Models
------------------

[](#customizing-models)

Every model is resolved through `OiLab\OiLaravelReviews\OiLaravelReviews`. Point `models.*` in the config at your own subclasses to add relations or behaviour without forking the package.

AI Assistant Skills
-------------------

[](#ai-assistant-skills)

This package ships an AI-assistant skill. Install it into your project:

```
php artisan oi:install-ai-skill
```

Testing
-------

[](#testing)

```
composer test
```

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

When contributing:

1. Write tests for new features
2. Ensure all tests pass: `vendor/bin/pest`
3. Follow existing code style
4. Update documentation as needed

License
-------

[](#license)

The MIT License (MIT). Please see the [License File](LICENSE) for more information.

Credits
-------

[](#credits)

**[Olivier Lacombe](https://www.olacombe.com)** - Creator and maintainer

Olivier is a Product &amp; Technology Director based in Montpellier, France, with over 20 years of experience innovating in UX/UI and emerging technologies. He specializes in guiding enterprises toward cutting-edge digital solutions, combining user-centered design with continuous optimization and artificial intelligence integration.

**Projects &amp; Resources:**

- [OI Dev Docs](https://dev.olacombe.com) - Documentation for all Open Source OI Lab packages
- [OnAI](https://onai.olacombe.com) - Training courses and masterclasses on generative AI for businesses
- [Promptr](https://promptr.olacombe.com) - Prompt engineering Management Platform

Support
-------

[](#support)

For support, please open an issue on the [GitHub repository](https://github.com/oi-lab/oi-laravel-reviews/issues).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/369876?v=4)[Olivier Lacombe](/maintainers/olacombe)[@olacombe](https://github.com/olacombe)

---

Tags

laravelreviewsmoderationratingsspatie-laravel-data

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/oi-lab-oi-laravel-reviews/health.svg)

```
[![Health](https://phpackages.com/badges/oi-lab-oi-laravel-reviews/health.svg)](https://phpackages.com/packages/oi-lab-oi-laravel-reviews)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45844.8k1](/packages/pressbooks-pressbooks)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)

PHPackages © 2026

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