azeddine_hf
Using Plugin Auto Panel How to Colorize Table Rows Conditionally
the uplugin gives us this func to overide the columns and forms and infolist :
public static function getColumnsOverwrite(): array
{
return [
'table' => [
Tables\Columns\TextColumn::make('category_id')->label('categorys')
->searchable()
->getStateUsing(function (Post $record) {
return $record->category->name;
}),
Tables\Columns\ImageColumn::make('thumbnail')->circular(),
Tables\Columns\ColorColumn::make('color'),
],
'form' => [
//
// Forms\Components\ColorPicker::make('color')->required(),
],
'infolist' => [
// Forms\Components\ColorPicker::make('color'),
// Tables\Columns\ColorColumn::make('color'),
Infolists\Components\ColorEntry::make('color'),
Infolists\Components\ImageEntry::make('thumbnail'),
Infolists\Components\TextEntry::make('category_id')->label('famillies')->getStateUsing(function (Post $record) {
return $record->category->name;
}),
],
];
}
but i don't know how to colorize the table rows conditionnaly ?
2 replies