lifeonscreen/nova-belongs-to-badge

A Laravel Nova belongs to badge field.

Installs: 4 704

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 1

Open Issues: 2

pkg:composer/lifeonscreen/nova-belongs-to-badge

v1.0.0 2019-05-20 12:50 UTC

This package is auto-updated.

Last update: 2025-10-21 03:21:06 UTC


README

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.