Laravel Packages

DigitalOcean API Client for Laravel

Published
DigitalOcean API Client for Laravel image

The Laravel DigitalOcean package by Graham Campbell is an API client bridge for Laravel. This package uses Graham's manager package, providing the ability to configure multiple connections.

use GrahamCampbell\DigitalOcean\Facades\DigitalOcean;
 
DigitalOcean::droplet()->powerOn(12345);
 
DigitalOcean::size()->getAll();
 
// Specify a connection name
DigitalOcean::connection('your_connection_name')
->droplet()
->getById(12345);

The package integrates with Laravel's service container, allowing you to use the package's Facade or use dependency injection to use the manager:

use GrahamCampbell\DigitalOcean\DigitalOceanManager;
 
public function __construct(private DigitalOceanManager $digitalocean)
{
// ...
$this->digitalocean->region()->getAll();
}

As mentioned in the README, this package is a bridge for the DigitalOcean PHP API client. You can see more examples of how you can use this client to interact with DigitalOcean.

For reference, the published digitalocean.php configuration file includes a setting to define the default connection name, as well as the ability to configure as many connections as you need:

return [
'default' => 'main',
 
'connections' => [
 
'main' => [
'token' => 'your-token',
'method' => 'token',
],
 
],
];

This package supports a wide variety of Laravel versions, the latest supporting Laravel v8 to v11. For more details, visit the GitHub repository and explore its extensive documentation and examples.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Sponsored

serpapi logo
SerpApi

The Web Search API for Your LLM and AI Applications

Visit SerpApi

The latest

View all →
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article
Laravel AI SDK Adds Human-in-the-Loop Tool Approval image

Laravel AI SDK Adds Human-in-the-Loop Tool Approval

Read article
Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals image

Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals

Read article
Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs image

Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs

Read article
Blade Formatting in Laravel Pint image

Blade Formatting in Laravel Pint

Read article
Inertia DevTools Is Now on the Chrome Web Store image

Inertia DevTools Is Now on the Chrome Web Store

Read article