Add LaborCategory resource — manage labor categories from UI
- Creates labor_categories table (company-scoped) seeded with 11 defaults - LaborCategory model with BelongsToTenant - Full Filament CRUD resource with drag-to-reorder (sort_order) - LaborResource category Select now reads from DB instead of hardcoded const - Navigation: 'Categorii manopere' in Service group, sort 33 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,7 @@ class LaborResource extends Resource
|
||||
->schema([
|
||||
Forms\Components\Select::make('category')
|
||||
->label(__('Categorie'))
|
||||
->options(\App\Support\I18n::opts(array_combine(Labor::CATEGORIES, Labor::CATEGORIES)))
|
||||
->options(fn () => \App\Models\Tenant\LaborCategory::orderBy('sort_order')->orderBy('name')->pluck('name', 'name'))
|
||||
->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(\App\Support\I18n::opts(array_combine(Labor::CATEGORIES, Labor::CATEGORIES))),
|
||||
->options(fn () => \App\Models\Tenant\LaborCategory::orderBy('sort_order')->orderBy('name')->pluck('name', 'name')),
|
||||
Tables\Filters\TernaryFilter::make('is_active')->label(__('Doar active')),
|
||||
])
|
||||
->actions([
|
||||
|
||||
Reference in New Issue
Block a user