Add multilingual support to labor categories (RO/RU/EN)

- Migration: adds name_ro, name_ru, name_en columns; copies name→name_ro;
  seeds RU and EN translations for all 11 default categories
- LaborCategory: label() returns localized name, optionsForSelect() keyed
  by canonical name (stored in labors.category) with localized label
- LaborCategoryResource: 3-column form with RO/RU/EN inputs; table shows
  all three columns side by side
- LaborResource: category select and filter use optionsForSelect()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-07 12:37:39 +00:00
parent 818ae29b20
commit 1b34a3c217
4 changed files with 102 additions and 17 deletions
@@ -53,7 +53,7 @@ class LaborResource extends Resource
->schema([
Forms\Components\Select::make('category')
->label(__('Categorie'))
->options(fn () => \App\Models\Tenant\LaborCategory::orderBy('sort_order')->orderBy('name')->pluck('name', 'name'))
->options(fn () => \App\Models\Tenant\LaborCategory::optionsForSelect())
->required()
->searchable(),
Forms\Components\TextInput::make('code')->label(__('Cod'))->maxLength(32),
@@ -100,7 +100,7 @@ class LaborResource extends Resource
])
->filters([
Tables\Filters\SelectFilter::make('category')
->options(fn () => \App\Models\Tenant\LaborCategory::orderBy('sort_order')->orderBy('name')->pluck('name', 'name')),
->options(fn () => \App\Models\Tenant\LaborCategory::optionsForSelect()),
Tables\Filters\TernaryFilter::make('is_active')->label(__('Doar active')),
])
->actions([