Giter Club home page Giter Club logo

mokhosh-filament-rating's Introduction

Add rating fields and columns to Filament forms and tables

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

Add beautiful and customizable rating fields and columns to Filament forms and tables.

Form Component Table Column Infolist Entry
Rating form component Rating table column Rating infolist entry

Installation

You can install the package via composer:

composer require mokhosh/filament-rating

Publish the assets so the styles are correct:

php artisan filament-rating:install

Usage

You can add a rating field to your forms like this:

use Mokhosh\FilamentRating\Components\Rating;

$form->schema([
    Rating::make(),
]);

You can add a rating column to your tables like this:

use Mokhosh\FilamentRating\Columns\RatingColumn;

$table->schema([
    RatingColumn::make(),
]);

You can add a rating entry to your infolists like this:

use Mokhosh\FilamentRating\Entries\RatingEntry;

$infolist->schema([
    RatingEntry::make(),
]);

Themes

You can choose the theme like this:

use Mokhosh\FilamentRating\RatingTheme;

$form->schema([
    Rating::make()->theme(RatingTheme::Simple),
]);

Maximum Stars

You can change the number of total stars like this:

$form->schema([
    Rating::make()->stars(10),
]);

Allowing Zero Stars

If you want to allow zero stars to be chosen, you can do so like this:

$form->schema([
    Rating::make()->allowZero(),
]);

Customizing The Size

You can customize the size of the stars. The accepted values are: xs, sm, md, lg and xl:

$form->schema([
    Rating::make()->size('sm'),
]);

Customizing Colors

You can customize the color of the stars by choosing one of the Filament theme colors.

Accepted values are danger, gray, info, primary, success and warning:

$form->schema([
    Rating::make()->color('success'),
]);

Testing

composer test

Changelog

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

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.

mokhosh-filament-rating's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar mokhosh avatar mvd81 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.