Added operator_id column
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user