Manage multiple DigitalOcean connections
11.1You can switch between different configured connections using the connection() method. If you use the default connection, you can omit the connection() call.
Key methods for managing connections:
connection('name'): Selects a specific connection.setDefaultConnection('name'): Changes the default connection for subsequent calls.getDefaultConnection(): Returns the name of the current default connection.
use GrahamCampbell\DigitalOcean\Facades
DigitalOcean;
// Using a specific connection
DigitalOcean::connection('your_connection_name')->droplet()->getById(12345);
// These are equivalent if 'main' is the default:
DigitalOcean::connection('main')->region()->getAll();
DigitalOcean::region()->getAll();
DigitalOcean::connection()->region()->getAll();
// Changing the default connection
DigitalOcean::setDefaultConnection('alternative');