legacy ids already present locally, as a lookup set */ public static function of(string $table, bool $requireCustomer = false): array { $query = DB::table($table)->whereNotNull('legacy_id'); if ($requireCustomer) { $query->whereNotNull('customer_id'); } return $query->pluck('legacy_id')->flip()->all(); } }