businessGoodSku = $businessGoodSku->toArray(); $this->num = $num; $this->updateStock(); } private function updateStock() { $this->goodsSku = GoodsSku::query() ->where('external_sku_id', $this->businessGoodSku['external_sku_id']) ->first(); if ($this->goodsSku) { $this->goodsSku->stock += $this->num; $this->goodsSku->save(); } } /** * Get the channels the event should broadcast on. * * @return \Illuminate\Broadcasting\Channel|array */ public function broadcastOn() { return new PrivateChannel('channel-name'); } }