1. Go to this page and download the library: Download toin0u/digitalocean-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// if you don't want to use the defaut adapter but rather Buzz
DigitalOcean::setAdapter(new \HttpAdapter\BuzzHttpAdapter());
$activeDroplets = DigitalOcean::droplets()->showAllActive();
var_dump($activeDroplets);
// object(stdClass)[61]
// public 'status' => string 'OK' (length=2)
// public 'droplets' =>
// array (size=1)
// 0 =>
// object(stdClass)[62]
// public 'id' => int 347553
// public 'name' => string 'foobar' (length=6)
// public 'image_id' => int 284212
// public 'size_id' => int 66
// public 'region_id' => int 4
// public 'backups_active' => boolean false
// public 'ip_address' => string '192.241.175.217' (length=15)
// public 'private_ip_address' => null
// public 'locked' => boolean false
// public 'status' => string 'active' (length=6)
// public 'created_at' => string '2013-01-07T01:37:21Z' (length=20)