LaravelPackages.net
Acme Inc.
Toggle sidebar
upline/row-background

Field to set row background.

8.524
0
0.2.1
About upline/row-background

upline/row-background is a Laravel package for field to set row background.. It currently has 0 GitHub stars and 8.524 downloads on Packagist (latest version 0.2.1). Install it with composer require upline/row-background. Discover more Laravel packages by upline or browse all Laravel packages to compare alternatives.

Last updated

Laravel Nova field to set background for resource rows

Set background color to resource row and auto choose white or black text color.

Usage

Add to your resource file:

use Upline\RowBackground\RowBackground;

and field to fields section

RowBackground::make('Background color')->onlyOnIndex();

or (to set text color)

 RowBackground::make('Background color', function ($model) {
    return new RowBackgroundData($model->background_color, $model->text_color);
})->onlyOnIndex();

Note:
This package works pretty tricky:
It deletes a column that nova adds to index view.
If you know better ways to set row styles, please write me.

Comments