Skip to content

The field for Laravel Nova which adds support for displaying badges for "BelongsTo" relation

Notifications You must be signed in to change notification settings

LifeOnScreen/nova-belongs-to-badge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Laravel Nova BelongTo Badge field. It extends the BelongsTo fields and displays badge on Index and Details page.

Details page

Example of badge in detail page:

Badge on detail page

Index page

Example of badge in index page:

Badge on index page

Installation

Via Composer

$ composer require lifeonscreen/nova-belongs-to-badge

To create migrations witch adds colors to your tables you can run:

$ php artisan make:migration:add-badge-colors {tableName}

Usage

Add this to Field list:

BelongsToBadge::make('Status', 'status', Status::class),

Field will read colors from badgeBackgroundColor and badgeForegroundColor attribute.

Security

If you discover any security-related issues, please email the author instead of using the issue tracker.

Credits

License

MIT license. Please see the license file for more information.

About

The field for Laravel Nova which adds support for displaying badges for "BelongsTo" relation

Resources

Stars

Watchers

Forks

Packages

No packages published