'decimal:2', 'member_price' => 'decimal:2', ]; protected static function booted(): void { static::saved(fn (self $row) => $row->dispatchSync()); static::deleted(fn (self $row) => $row->dispatchSync()); } /** * 推送 B012 同步指令給該機台,讓它即時重抓最新定價。 * 控制台/離線判定沿用 SendProductSyncCommandJob 既有邏輯。 */ protected function dispatchSync(): void { SendProductSyncCommandJob::dispatch($this->machine_id, __('Machine pricing updated')); } public function machine() { return $this->belongsTo(Machine::class); } public function product() { return $this->belongsTo(Product::class); } }