Search by

jeffersongoncalves / filament-review-rateable

jeffersongoncalves

Filament components (star rating field, column, entry and reviews relation manager) for codebyray/laravel-review-rateable

Package info

github.com/jeffersongoncalves/filament-review-rateable

pkg:composer/jeffersongoncalves/filament-review-rateable

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

3.0.0 2026-12-03 15:38 UTC

This package is auto-updated.

Last update: 2026-12-03 15:43:40 UTC


README

Filament Review Rateable

Filament Review Rateable

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads License

Filament UI for codebyray/laravel-review-rateable: a star rating form field, a star rating table column and infolist entry, and a ready-made reviews relation manager to create, edit, approve and delete reviews of any reviewable model.

Compatibility

Package Version Filament Version
1.x 3.x
2.x 4.x
3.x 5.x

Installation

You can install the package via composer:

composer require jeffersongoncalves/filament-review-rateable:"^3.0"

Set up the core package (config + migrations) if you haven't yet:

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

Add the ReviewRateable trait to the models that receive reviews:

use Codebyray\ReviewRateable\Traits\ReviewRateable;

class Product extends Model
{
    use ReviewRateable;
}

The components need no CSS build step: stars are inline SVG.

Usage

Reviews relation manager

Add it to the resource of any reviewable model:

use JeffersonGoncalves\Filament\ReviewRateable\RelationManagers\ReviewsRelationManager;

public static function getRelations(): array
{
    return [
        ReviewsRelationManager::class,
    ];
}

It lists the reviews with author, average stars, text, department, recommendation and an approval toggle, filters by approval and department, and creates/edits reviews through the core ReviewRateableContract service, showing one star input per rating key of the selected department (review-rateable.departments). New reviews are attributed to the authenticated user.

Rating column

Show the average rating of a reviewable record:

use JeffersonGoncalves\Filament\ReviewRateable\Tables\Columns\RatingColumn;

RatingColumn::make('rating')->average('overall');                // one criterion
RatingColumn::make('rating')->average(null);                     // every criterion combined
RatingColumn::make('rating')->average('overall', department: 'sales');

Without average() the column renders any numeric state as stars, e.g. RatingColumn::make('ratings_avg_value').

Rating entry

Same API for infolists:

use JeffersonGoncalves\Filament\ReviewRateable\Infolists\Components\RatingEntry;

RatingEntry::make('rating')->average('overall');

Rating input

A clickable star field for your own forms:

use JeffersonGoncalves\Filament\ReviewRateable\Forms\Components\RatingInput;

RatingInput::make('ratings.overall')
    ->label('Overall')
    ->required();

Bounds default to review-rateable.min_rating_value / max_rating_value and can be overridden with ->minRating() / ->maxRating() (also available on the column and the entry). Values outside the range fail validation.

Plugin

Registering the plugin is optional; the components work standalone:

use JeffersonGoncalves\Filament\ReviewRateable\ReviewRateablePlugin;

$panel->plugins([
    ReviewRateablePlugin::make(),
]);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.