shipmentId; } public function handle(ShipmentTrackingRecorder $recorder): void { if ($this->batch()?->cancelled()) { return; } $shipment = Shipment::find($this->shipmentId); // Cancelled (or deleted) since the batch was built. if (! $shipment || $shipment->isCancelled()) { return; } $recorder->refresh($shipment); } }