1. Go to this page and download the library: Download packstub/filament-rating library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
packstub / filament-rating example snippets
use Packstub\FilamentRating\Components\Rating;
Rating::make('rating')
->
Rating::make('rating')
->stars(10) // default 5
->allowZero() // adds a "no stars" button that stores 0
->allowHalf() // 0.5 steps: the left half of a star picks the half value
->clearable() // click the selected star again, press Delete, or use the × button
->size('lg') // xs, sm, md (default), lg, xl, 2xl, or an IconSize
->color('warning') // default primary
->readOnly();
use Packstub\FilamentRating\Columns\RatingColumn;
RatingColumn::make('rating')
->sortable()
->searchable();
use Packstub\FilamentRating\Filters\RatingFilter;
RatingFilter::make('rating'); // 5 stars, 4 stars & up, … 1 star & up
RatingFilter::make('rating')->stars(10);
RatingFilter::make('rating')->exact(); // 5 stars, 4 stars, …
use Packstub\FilamentRating\Summarizers\RatingAverage;
RatingColumn::make('rating')
->stars(10)
->color('amber')
->summarize(RatingAverage::make());
use Packstub\FilamentRating\Summarizers\RatingDistribution;
RatingColumn::make('rating')
->summarize(RatingDistribution::make()); // ->percentages() for "40%" instead of counts
use Packstub\FilamentRating\Entries\RatingEntry;
RatingEntry::make('rating')
->showValue()
->size('lg');
use Filament\Support\Facades\FilamentIcon;
use Packstub\FilamentRating\RatingIcon;
FilamentIcon::register([
RatingIcon::Star => 'heroicon-s-heart',
RatingIcon::StarEmpty => 'heroicon-o-heart',
]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.