record; $sticker = StickerMaster::where('plant_id', $record->plant_id)->where('item_id', $record->item_id)->first(); if($sticker) { $scannedQuantity = PanelBoxValidation::where('plant_id', $record->plant_id) ->where('production_order', $record->document_number) ->where('inspection_lot_number', $record->inspection_lot_number) ->where('sticker_master_id', $sticker->id) ->count(); } if ((int) $data['quantity'] < $scannedQuantity) { Notification::make() ->title('Invalid Quantity') ->body("Already scanned quantity is {$scannedQuantity}.
Panel GR Master quantity cannot be less than {$scannedQuantity}.") ->danger() ->send(); $this->halt(); } $data['updated_by'] = Filament::auth()->user()?->name; $data['updated_at'] = now(); return $data; } protected function getHeaderActions(): array { return [ Actions\ViewAction::make(), Actions\DeleteAction::make(), Actions\ForceDeleteAction::make(), Actions\RestoreAction::make(), ]; } }