worker_host ??= gethostname(); }); } protected function initializeRecordsWorkerHost(): void { $this->hidden[] = 'worker_host'; } /** * Rows without a host were created before the column existed, so they can belong to this host. */ public function scopeOnThisHost(Builder $query): Builder { return $query->where(fn (Builder $query) => $query->where('worker_host', gethostname())->orWhereNull('worker_host')); } }