Fix client/vehicle inline creation and labor catalog visibility

- Migration: make clients.phone nullable (was NOT NULL, broke inline create)
- Vehicle createOptionUsing: use Get callback instead of $livewire->data
  to reliably get client_id in the vehicle inline form
- Remove plate->required() on inline vehicle form (not required in DB)
- Rename 'Norme-ore' → 'Catalog manopere'/'Каталог работ' in navigation
  so users can find the labor catalog easily

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-07 12:08:14 +00:00
parent 6848e58f14
commit aba1fcc372
4 changed files with 27 additions and 5 deletions
@@ -102,12 +102,12 @@ class WorkOrderResource extends Resource
->createOptionForm([ ->createOptionForm([
Forms\Components\TextInput::make('make')->label(__('Marcă'))->required(), Forms\Components\TextInput::make('make')->label(__('Marcă'))->required(),
Forms\Components\TextInput::make('model')->label(__('Model'))->required(), Forms\Components\TextInput::make('model')->label(__('Model'))->required(),
Forms\Components\TextInput::make('plate')->label(__('Nr. înmatriculare'))->required(), Forms\Components\TextInput::make('plate')->label(__('Nr. înmatriculare')),
Forms\Components\TextInput::make('year')->label(__('An'))->numeric(), Forms\Components\TextInput::make('year')->label(__('An'))->numeric(),
Forms\Components\TextInput::make('vin')->label(__('VIN')), Forms\Components\TextInput::make('vin')->label(__('VIN')),
]) ])
->createOptionUsing(function (array $data, \Livewire\Component $livewire) { ->createOptionUsing(function (array $data, Get $get) {
$data['client_id'] = data_get((array) $livewire->data, 'client_id'); $data['client_id'] = $get('client_id');
return Vehicle::create($data)->id; return Vehicle::create($data)->id;
}), }),
Forms\Components\Select::make('master_id')->label(__('Maistru')) Forms\Components\Select::make('master_id')->label(__('Maistru'))
@@ -0,0 +1,22 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('clients', function (Blueprint $table) {
$table->string('phone')->nullable()->change();
});
}
public function down(): void
{
Schema::table('clients', function (Blueprint $table) {
$table->string('phone')->nullable(false)->change();
});
}
};
+1 -1
View File
@@ -51,7 +51,7 @@ return [
'Jurnal activitate' => 'Jurnal activitate', 'Jurnal activitate' => 'Jurnal activitate',
'KPI mecanici' => 'KPI mecanici', 'KPI mecanici' => 'KPI mecanici',
'Lucrări terți' => 'Lucrări terți', 'Lucrări terți' => 'Lucrări terți',
'Norme-ore' => 'Norme-ore', 'Norme-ore' => 'Catalog manopere',
'Pipeline' => 'Pipeline', 'Pipeline' => 'Pipeline',
'Pipeline (tabel)' => 'Pipeline (tabel)', 'Pipeline (tabel)' => 'Pipeline (tabel)',
'Planuri' => 'Planuri', 'Planuri' => 'Planuri',
+1 -1
View File
@@ -51,7 +51,7 @@ return [
'Jurnal activitate' => 'Журнал действий', 'Jurnal activitate' => 'Журнал действий',
'KPI mecanici' => 'KPI механиков', 'KPI mecanici' => 'KPI механиков',
'Lucrări terți' => 'Работы субподрядчиков', 'Lucrări terți' => 'Работы субподрядчиков',
'Norme-ore' => 'Нормо-часы', 'Norme-ore' => 'Каталог работ',
'Pipeline' => 'Воронка', 'Pipeline' => 'Воронка',
'Pipeline (tabel)' => 'Воронка (таблица)', 'Pipeline (tabel)' => 'Воронка (таблица)',
'Planuri' => 'Тарифы', 'Planuri' => 'Тарифы',