PHP code example of lartisan / filament-rating-tool

1. Go to this page and download the library: Download lartisan/filament-rating-tool 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/ */

    

lartisan / filament-rating-tool example snippets


RatingInput::make('rating')
    ->size('xl')
    ->maxValue(5)
    ->icon('heroicon-o-stop')
    ->color(fn (int $state): string => match ($state) {
        1 => 'danger',
        2 => 'warning',
        3 => 'info',
        4 => 'primary',
        5 => 'success',
        default => 'gray',
    }),

RatingInput::make('rating')
    ->color('warning')
    // ...

RatingColumn::make('rating')
    ->size('xs')
    ->maxValue(5)
    ->icon('heroicon-s-star')
    ->color(fn (int $state): string => match ($state) {
        1 => 'danger',
        2 => 'warning',
        3 => 'info',
        4 => 'primary',
        5 => 'success',
        default => 'gray',
    }),
    // ...

RatingEntry::make('rating')
    ->columnSpan(2)
    ->size('lg')
    ->maxValue(5)
    ->icon('heroicon-s-user')
    ->color(fn (int $state): string => match ($state) {
        1 => 'danger',
        2 => 'warning',
        3 => 'info',
        4 => 'primary',
        5 => 'success',
        default => 'gray',
    }),
    // ...
bash
php artisan vendor:publish --tag="filament-rating-tool-views"