Simple Laravel Nova BelongTo Badge field. It extends the BelongsTo fields and displays badge on Index and Details page.
Example of badge in detail page:
Example of badge in index page:
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}
Add this to Field list:
BelongsToBadge::make('Status', 'status', Status::class),
Field will read colors from badgeBackgroundColor
and badgeForegroundColor
attribute.
If you discover any security-related issues, please email the author instead of using the issue tracker.
MIT license. Please see the license file for more information.