dispatch(self::RunEnqueued, tenantId: $tenantId)->to(BulkOperationProgress::class); $livewire->dispatch(self::RunEnqueued, tenantId: $tenantId)->to(InventoryKpiHeader::class); } private static function resolveTenantId(ManagedEnvironment|int|null $tenant): ?int { if ($tenant instanceof ManagedEnvironment) { return (int) $tenant->getKey(); } if (is_int($tenant) && $tenant > 0) { return $tenant; } $currentTenantId = Filament::getTenant()?->getKey(); if (! is_numeric($currentTenantId)) { return null; } $currentTenantId = (int) $currentTenantId; return $currentTenantId > 0 ? $currentTenantId : null; } }