Download the PHP package ghanem/rating-filament without Composer

On this page you can find all versions of the php package ghanem/rating-filament. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rating-filament

Latest Stable Version License Tests

Laravel Rating for Filament

Filament 4 & 5 components for ghanem/rating (Packagist) — a star input field, a sortable average-rating table column, an infolist entry, and a relation manager for moderating reviews.

This package is admin-panel only. Ratings themselves — the traits, aggregates, scopes, events and validation — live in ghanem/rating, which is required automatically. Read its README first if you have not set up the Ratingable and CanRate traits yet.

Installation

filament:assets publishes the star stylesheet into public/. Re-run it after every upgrade of this package — Filament plugins are not compiled by your app's Tailwind build, so without it the stars render unstyled.

This pulls in ghanem/rating ^2.1. If you have not already published its migration:

Table column

Show a sortable average rating on a resource's table. The modifyQueryUsing line is required — it selects the ratings_avg_rating alias the column reads, which is what keeps the table to one query instead of one per row.

Scoping to a rating type happens in the query, not on the column:

Form field

The star count defaults to config('rating.max'), and the field attaches min/max validation rules from the same config so an out-of-range value produces a field error instead of an InvalidRatingException.

allowHalf() lets the field store and render half-point values (2.5, 3.5, ...). Clicking the left half of a star selects the half value, and the star is drawn half-filled to match.

Infolist entry

Relation manager

Then register it on the resource:

It lists the ratings a record has received, with edit and delete actions for moderation. There is no create action by default, because the correct author for an admin-created rating is application-specific.

Customising the markup

Dark mode

The components ship their own stylesheet and follow the panel's theme — filled stars keep their colour, empty stars darken from gray-300 to gray-600 under Filament's dark class. Nothing to configure.

starColor() still takes any CSS colour and is applied through a custom property, so it composes with the theme rather than fighting it:

Both layouts use CSS logical properties, so under dir="rtl" the stars fill from the right edge and half-star selection follows the pointer correctly.

Translations

English and Arabic ship in the box. Every label, helper text and screen-reader string resolves through Laravel's translator, so a locale you add is picked up automatically.

To adjust the bundled strings or add a locale:

That writes to lang/vendor/rating-filament/{locale}/rating-filament.php. Translations are welcome as pull requests — copy resources/lang/en and keep the key set identical; a test enforces that every locale stays in step.

Known limitation

Ratingable::ratings() and CanRate::ratings() share a method name, so a model cannot use both traits without resolving the collision with insteadof. This relation manager always means ratings received.

Related packages

Sponsor

Become a Sponsor


All versions of rating-filament with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ghanem/rating Version ^2.1
filament/filament Version ^4.0|^5.0
illuminate/support Version ^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ghanem/rating-filament contains the following files

Loading the files please wait ...