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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package digitalocean

DigitalOcean API for Laravel

laravel-digitalocean

tests Latest Version

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

PHP Build Version
Package Version
Requires php Version ^8.2
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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lionix/digitalocean contains the following files

Loading the files please wait ...