From 06fac16026246f7b3c74c20a40fafbc234a2ea90 Mon Sep 17 00:00:00 2001 From: Vasyka Date: Mon, 7 Sep 2026 13:07:34 +0000 Subject: [PATCH] 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 --- app/Filament/Tenant/Resources/LaborResource.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Filament/Tenant/Resources/LaborResource.php b/app/Filament/Tenant/Resources/LaborResource.php index 43bec1a..6cbd67c 100644 --- a/app/Filament/Tenant/Resources/LaborResource.php +++ b/app/Filament/Tenant/Resources/LaborResource.php @@ -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'); }