Fix labor catalog group headers to show localized category names

Defines a proper Tables\Grouping\Group with getTitleFromRecordUsing so
group headers use the locale-aware label from LaborCategory::optionsForSelect()
instead of the raw DB value with Filament's hardcoded "Category:" prefix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-07 13:07:34 +00:00
parent 116a53d81d
commit 06fac16026
@@ -117,6 +117,15 @@ class LaborResource extends Resource
Actions\DeleteAction::make(),
])
->defaultSort('category')
->groups([
Tables\Grouping\Group::make('category')
->label(__('Categorie'))
->getTitleFromRecordUsing(function ($record) {
static $opts = null;
$opts ??= \App\Models\Tenant\LaborCategory::optionsForSelect();
return $opts[$record->category] ?? $record->category;
}),
])
->defaultGroup('category');
}