ibrahimbougaoua/filament-rating-star

This is my package filament-rating-star

v1.0.2 2024-04-15 06:25 UTC

This package is not auto-updated.

Last update: 2024-04-30 20:57:05 UTC


README

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

Star rating field & Star column.
rating.png
Youtube Video

ibrahim-bougaoua-star-rating.jpg

Installation

You can install the package via composer:

composer require ibrahimbougaoua/filament-rating-star

You can publish and run the migrations with:

php artisan vendor:publish --tag="filament-rating-star-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="filament-rating-star-config"

This is the contents of the published config file:

return [
    'stars' => [
        'star1' => '1',
        'star2' => '2',
        'star3' => '3',
        'star4' => '4',
        'star5' => '5',
    ]
];

Optionally, you can publish the views using

php artisan vendor:publish --tag="filament-rating-star-views"

Usage

With Form :

return $form
    ->schema([
        Section::make()
            ->schema([
                RatingStar::make('rating')
                ->label('Rating')
            ])
        ])

With Table :

use IbrahimBougaoua\FilamentRatingStar\Columns\RatingStarColumn;

return $table
    ->columns([
        RatingStarColumn::make('rating')
    ])

You can use the size method to customize the size of the stars:

use IbrahimBougaoua\FilamentRatingStar\Columns\RatingStarColumn;

return $table
    ->columns([
        RatingStarColumn::make('rating')
            ->size('sm')
    ])

Supported sizes are xs, sm, md, lg and xl.

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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