diff --git a/app/Models/ProductionLineStop.php b/app/Models/ProductionLineStop.php index 242fd78..46d2395 100644 --- a/app/Models/ProductionLineStop.php +++ b/app/Models/ProductionLineStop.php @@ -19,6 +19,7 @@ class ProductionLineStop extends Model "to_datetime", "stop_hour", "stop_min", + "operator_id", ]; public function plant(): BelongsTo diff --git a/app/Models/ProductionPlan.php b/app/Models/ProductionPlan.php index b20a2c1..56ca38c 100644 --- a/app/Models/ProductionPlan.php +++ b/app/Models/ProductionPlan.php @@ -17,6 +17,7 @@ class ProductionPlan extends Model "line_id", "plan_quantity", "production_quantity", + "operator_id", ]; public function plant(): BelongsTo diff --git a/app/Models/ProductionQuantity.php b/app/Models/ProductionQuantity.php index 797ef7c..85f4ab0 100644 --- a/app/Models/ProductionQuantity.php +++ b/app/Models/ProductionQuantity.php @@ -3,6 +3,7 @@ namespace App\Models; use Carbon\Carbon; +use Filament\Facades\Filament; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -20,6 +21,7 @@ class ProductionQuantity extends Model "item_id", "serial_number", "production_order", + "operator_id", ]; public function plant(): BelongsTo @@ -69,10 +71,13 @@ class ProductionQuantity extends Model ->first(); } + $operatorName = Filament::auth()->user()->name; + if ($productionPlan) { $productionPlan->update([ 'production_quantity' => $productionPlan->production_quantity + 1, 'updated_at' => now(), + 'operator_id'=> $operatorName, ]); } });