Download the PHP package lionix/digitalocean without Composer
On this page you can find all versions of the php package lionix/digitalocean. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package digitalocean
DigitalOcean API for Laravel

A lightweight DigitalOcean API v2 client for Laravel, created by Arayik Smbatyan (@arayiksmbatyan) at Lionix.
It talks to the REST API directly through Laravel's HTTP client — no external SDK — so it is easy to extend
and fully testable with Http::fake().
Requirements
| Package | PHP | Laravel |
|---|---|---|
| 2.x | 8.2 – 8.5 | 12, 13 |
| 1.x | 8.0+ | 8 – 10 |
Laravel 13 itself requires PHP 8.3+.
Installation
The service provider and facades are registered automatically via package discovery.
Publish the config file (optional):
Configuration
Generate a Personal Access Token with write scope and
add it to your .env file:
Available services
| Facade | Global accessor | API |
|---|---|---|
Droplets |
Digitalocean::droplets() |
Droplets |
DropletActions |
Digitalocean::dropletActions() |
Droplet actions (power, resize, …) |
Snapshots |
Digitalocean::snapshots() |
Snapshots |
Domains |
Digitalocean::domains() |
Domains |
DomainRecords |
Digitalocean::domainRecords() |
DNS records |
SshKeys |
Digitalocean::sshKeys() |
SSH keys |
Firewalls |
Digitalocean::firewalls() |
Cloud firewalls |
ReservedIps |
Digitalocean::reservedIps() |
Reserved (floating) IPs |
Cdn |
Digitalocean::cdn() |
CDN endpoints and cache purge |
Actions |
Digitalocean::actions() |
Action status and waiting |
Regions |
Digitalocean::regions() |
Regions |
Sizes |
Digitalocean::sizes() |
Droplet sizes |
Images |
Digitalocean::images() |
Images |
| — | Digitalocean::account() |
Account info and balance |
The service classes live in Digitalocean\Services and the facades in Digitalocean\Facades.
Usage
Every service can be used in three ways:
Responses
Every method returns the decoded JSON response as an array with the HTTP status code added under status_code.
API errors are returned the same way, so you can check them without catching exceptions:
store() methods validate their input first and throw Illuminate\Validation\ValidationException on invalid
data. Network failures throw Illuminate\Http\Client\ConnectionException.
Droplets
Droplet Actions
Domains
Snapshots
DNS Records
SSH Keys
Regions, Sizes and Images
Reference data for building a "create droplet" form:
Firewalls
Reserved IPs
CDN
Actions
Most write operations (snapshots, power actions, IP assignment…) return an action. You can check it or wait for it:
Account
Any other endpoint
The global service can call any endpoint that does not have a dedicated wrapper yet:
For full control you can grab a pre-configured PendingRequest (base URL, token, timeout and retries already set):
Artisan commands
Snapshot
| Option | Description |
|---|---|
--dropletId |
Droplet ID. Falls back to DO_DROPLET_ID, then asks interactively. |
--name |
Snapshot name prefix (defaults to the droplet ID). The current date-time is appended. |
--dropOldSnapshots |
Delete the droplet's existing snapshots once the new snapshot is requested. |
--wait |
Wait until the snapshot has finished. |
--timeout |
Maximum seconds to wait with --wait (default 3600). |
Old snapshots are only removed if the new snapshot request succeeds, and with --wait only once the snapshot has
actually completed. The command exits with a non-zero code on failure, so it is safe to schedule:
CDN purge
Handy as the last step of a deploy script.
Testing
Because the package uses Laravel's HTTP client, you can fake DigitalOcean in your own tests:
Run the package test suite:
Upgrading from 1.x
See CHANGELOG.md.
Releasing
Add a ## [x.y.z] - date section at the top of CHANGELOG.md and merge it into master. The release workflow
then creates the x.y.z tag and a GitHub Release with that section as notes, and Packagist picks up the tag.
To tag an older commit, run the workflow manually with a version and a full commit SHA as ref.
License
The MIT License (MIT).
All versions of digitalocean with dependencies
guzzlehttp/guzzle Version ^7.8
illuminate/console Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
illuminate/validation Version ^12.0|^13.0