All Projects → nikaia → nova-rating-field

nikaia / nova-rating-field

Licence: MIT license
A Star rating field to use in your Laravel Nova apps.

Programming Languages

Vue
7211 projects
PHP
23972 projects - #3 most used programming language
shell
77523 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects

Projects that are alternatives of or similar to nova-rating-field

nova-url-field
A URL input and link field for Laravel Nova
Stars: ✭ 96 (+128.57%)
Mutual labels:  laravel-package, laravel-nova
nova-qrcode-field
A Laravel Nova field to generate QR Code
Stars: ✭ 28 (-33.33%)
Mutual labels:  laravel-package, laravel-nova
Laravel Comment
Just another comment system for your awesome Laravel project.
Stars: ✭ 217 (+416.67%)
Mutual labels:  laravel-package
Nexmo Laravel
Add Nexmo functionality such as SMS and voice calling to your Laravel app with this Laravel Service Provider.
Stars: ✭ 250 (+495.24%)
Mutual labels:  laravel-package
Laravel Views
Laravel package to create beautiful common views like data tables using the TALL stack.
Stars: ✭ 221 (+426.19%)
Mutual labels:  laravel-package
Laravel Versionable
⏱️Make Laravel model versionable
Stars: ✭ 218 (+419.05%)
Mutual labels:  laravel-package
Auth Tests
Always-current tests for Laravel's authentication system. Curated by the community.
Stars: ✭ 230 (+447.62%)
Mutual labels:  laravel-package
Meter
Laravel package to find performance bottlenecks in your laravel application.
Stars: ✭ 204 (+385.71%)
Mutual labels:  laravel-package
madzipper
Wannabe successor of Chumper/Zipper package for Laravel
Stars: ✭ 114 (+171.43%)
Mutual labels:  laravel-package
Wagonwheel
Offer an online version of your Laravel emails to users.
Stars: ✭ 224 (+433.33%)
Mutual labels:  laravel-package
Laravel Localization
Easy localization for Laravel
Stars: ✭ 2,816 (+6604.76%)
Mutual labels:  laravel-package
Wisteria
Beautiful document tool for your project.
Stars: ✭ 226 (+438.1%)
Mutual labels:  laravel-package
Sneaker
An easy way to send emails whenever an exception occurs on server.
Stars: ✭ 223 (+430.95%)
Mutual labels:  laravel-package
Laravel Multilingual Routes
A package to handle multilingual routes in your Laravel application.
Stars: ✭ 241 (+473.81%)
Mutual labels:  laravel-package
Laravel Terminator
A package to help you clean up your controllers in laravel
Stars: ✭ 217 (+416.67%)
Mutual labels:  laravel-package
Laravel User Activity
Monitor user activity easily!
Stars: ✭ 253 (+502.38%)
Mutual labels:  laravel-package
Laravel State Machine
Winzou State Machine service provider for Laravel
Stars: ✭ 213 (+407.14%)
Mutual labels:  laravel-package
Clamav Validator
Laravel virus validator based on ClamAV anti-virus scanner
Stars: ✭ 224 (+433.33%)
Mutual labels:  laravel-package
Laravel Query Monitor
Simple artisan command to monitoring triggered queries
Stars: ✭ 230 (+447.62%)
Mutual labels:  laravel-package
nova-errors
Display all form errors in a modal at the top of the page.
Stars: ✭ 16 (-61.9%)
Mutual labels:  laravel-nova

Nova Rating field

A Star rating field to use in your Laravel Nova apps.

Uses vue-star-rating.

Latest Version on Packagist Total Downloads


Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require nikaia/nova-rating-field

Next you can use the Nikaia\Rating\Rating field in your Nova resource.

Usage

public function fields(Request $request)
{
    return [
        // ...

        Rating::make('Rating')->min(0)->max(5)->increment(0.5)->hideFromIndex(),
        
        // Defining a custom style for the index page.
        Rating::make('Rating')->min(0)->max(5)->increment(0.5)->hideRating()
            ->withStyles([
                'star-size' => 15,
                'rounded-corners' => true,
            ])->onlyOnIndex()->sortable(),

        // ...    
        
    ];
}

Defining properties

public function fields(Request $request)
{
    Rating::make('Rating')
    
        // Miniumum rating (default: 0)
        ->min(0) 
        
        // Maximum rating (default: 5)
        // This is how the component knows how many stars it should display.
        ->max(5)
        
        // Incremet (default: 1)
        // Can be float. The underlying eloquent colum must be defined as float in that case.
        // ie. 0.5 for half stars or 0.01 for fluid stars.
        ->increment(0.5)
        
        // Show rating value next to the stars
        ->hideRating()
        
}

Customizing styles

You can style the component using withStyles method. Options are passed to the the underlying vue component style props.

Default values are :

public function fields(Request $request)
{
    Rating::make('Rating')
        ->withStyles([
            'star-size' => 30,
            'active-color' => 'var(--primary)', // Primary nova theme color.
            'inactive-color' => '#d8d8d8',
            'border-color' => 'var(--60)',
            'border-width' => 0,
            'padding' => 10,
            'rounded-corners' => false,
            'inline' => false,
            'glow' => 0,
            'glow-color' => '#fff',
            'text-class' => 'inline-block text-80 h-9 pt-2',
        ]);
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].