where('status', 1) ->orderBy('id') ->first(); if (!$vcenter) { return response()->json([ 'error' => true, 'message' => 'Active vCenter configuration is unavailable', ], 503); } $username = trim((string) $vcenter->user); $password = SignRSA::DecryptFunc($vcenter->password); $host = trim((string) $vcenter->host); $port = 443; if ($host === '' || $port < 1 || $username === '' || $password === '') { return response()->json([ 'error' => true, 'message' => 'Active vCenter configuration is incomplete', ], 503); } return response()->json([ 'success' => true, 'data' => [ 'host' => $host, 'port' => $port, 'username' => $username, 'password' => $password, ], ])->header('Cache-Control', 'no-store, private'); } }