src/Servers/Adapters/DigitalOcean.php
public function create($params = array())
    {
        $serverConfig = array_merge($this->defaults, $params);

        try {
            $response = $this->client->request->post($this->apiEndpoint."/droplets", ['json' => $serverConfig]);

            if (202 != $this->client->getStatus($response)) {
                throw new Exception('Unable to create server.');
            }
        } catch (Exception $e) {
            echo 'Unable to create server because '.$e->getMessage();
        }

        return $this->client->getBody($response);
    }
public function create($params = array())
    {
        $serverConfig = array_merge($this->defaults, $params);

        try {
            $response = $this->client->request->post($this->apiEndpoint."/droplets", ['json' => $serverConfig]);

            if (202 != $this->client->getStatus($response)) {
                throw new Exception('Unable to create server.');
            }
        } catch (Exception $e) {
            echo 'Unable to create server because '.$e->getMessage();
        }

        return $this->client->getBody($response);
    }
public function create ( $ params = array ( ) ) { $ serverConfig = array_merge ( $ this -> defaults , $ params ) ; try { $ response = $ this -> client -> request -> post ( $ this -> apiEndpoint . "/droplets" , [ 'json' => $ serverConfig ] ) ; if ( 202 != $ this -> client -> getStatus ( $ response ) ) { throw new Exception ( 'Unable to create server.' ) ; } } catch ( Exception $ e ) { echo 'Unable to create server because ' . $ e -> getMessage ( ) ; } return $ this -> client -> getBody ( $ response ) ; }
Create a new server based on parameters received.

@param array $params
@return array
Create a new server based on parameters received .