setAttribute('hosting_credentials', self::for($service)); } } public static function for(Service $service): ?array { $hosting = $service->hostingAccount; $client = $hosting ? ModuleHostingPleskClient::forHosting($hosting) : null; if (!$client) { return null; } return [ 'host' => $hosting->server?->publicHost(), 'ip' => $hosting->server?->ip_address, 'panel_url' => $hosting->server?->panelUrl(), 'username' => $client->login, 'password' => Crypt::decryptString($client->password), ]; } }