lifeonscreen/nova-belongs-to-badge

A Laravel Nova belongs to badge field.

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

This package is auto-updated.

Last update: 2024-10-21 01:19:17 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.