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:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user