{"id":13796229,"url":"https://github.com/dunglas/DunglasDigitalOceanBundle","last_synced_at":"2025-05-13T00:30:48.695Z","repository":{"id":43190552,"uuid":"401751103","full_name":"dunglas/DunglasDigitalOceanBundle","owner":"dunglas","description":"DigitalOcean API v2 client for Symfony and API Platform","archived":false,"fork":false,"pushed_at":"2022-07-27T05:15:46.000Z","size":10,"stargazers_count":26,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-14T09:12:07.408Z","etag":null,"topics":["api-platform","devops","digitalocean","kubernetes","php","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dunglas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["dunglas"]}},"created_at":"2021-08-31T15:21:07.000Z","updated_at":"2024-03-02T08:58:00.000Z","dependencies_parsed_at":"2022-08-31T15:10:16.630Z","dependency_job_id":null,"html_url":"https://github.com/dunglas/DunglasDigitalOceanBundle","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunglas%2FDunglasDigitalOceanBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunglas%2FDunglasDigitalOceanBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunglas%2FDunglasDigitalOceanBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunglas%2FDunglasDigitalOceanBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dunglas","download_url":"https://codeload.github.com/dunglas/DunglasDigitalOceanBundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224850068,"owners_count":17380129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-platform","devops","digitalocean","kubernetes","php","symfony","symfony-bundle"],"created_at":"2024-08-03T23:01:07.767Z","updated_at":"2025-05-13T00:30:48.635Z","avatar_url":"https://github.com/dunglas.png","language":"PHP","funding_links":["https://github.com/sponsors/dunglas"],"categories":["Table of Contents"],"sub_categories":["awesome-api-platform-bundles"],"readme":"# DigitalOcean Bundle for Symfony and API Platform\n\nDunglasDigitalOceanBundle allows using [the DigitalOcean API](https://docs.digitalocean.com/reference/api/api-reference/)\nfrom your [Symfony](https://symfony.com) and [API Platform](https://api-platform.com) projects.\nIt registers the [DigitalOcean PHP API Client](https://github.com/DigitalOceanPHP/Client) as a Symfony service.\n\nIf you aren't yet a DigitalOcean user, use [this affiliate link](https://m.do.co/c/5d8aabe3ab80) to get $100 in free credit!\n\nIf you want to deploy your Symfony apps to DigitalOcean, [checkout this tutorial](https://github.com/dunglas/symfony-docker/blob/main/docs/production.md).\n\n## Example\n\n```php\n// src/Controller/DigitalOceanController.php\nnamespace App\\Controller;\n\nuse DigitalOceanV2\\Client;\nuse DigitalOceanV2\\ResultPager;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\\Routing\\Annotation\\Route;\n\nclass ProductController\n{\n    #[Route(\"/droplets\")]\n    public function listDroplets(Client $doClient): Response\n    {\n        // get the first 100 droplets as an array\n        $droplets = $doClient-\u003edroplet()-\u003egetAll();\n        \n        // or create a new result pager\n        $pager = new ResultPager($doClient);\n\n        // and get all droplets as an array\n        $droplets = $pager-\u003efetchAll($doClient-\u003edroplet(), 'getAll'); \n\n        // ...\n    }\n}\n```\n\nOf course, you can also inject the client service into your commands, messenger handlers and any other service.\n\n[More examples](https://github.com/DigitalOceanPHP/Client#examples).\n\n## Installation\n\nMake sure Composer is installed globally, as explained in the\n[installation chapter](https://getcomposer.org/doc/00-intro.md)\nof the Composer documentation.\n\n### Applications that use Symfony Flex\n\nOpen a command console, enter your project directory and execute:\n\n```console\ncomposer require dunglas/digital-ocean-bundle symfony/http-client nyholm/psr7 guzzlehttp/promises\n```\n\nThe previous command installs the bundle, Symfony HttpClient and [the dependencies it needs](https://symfony.com.ua/doc/current/http_client.html#psr-18-and-psr-17)\nto \"provide\" [`psr/http-client-implementation`](https://packagist.org/providers/psr/http-client-implementation) and [`psr/http-factory-implementation`](https://packagist.org/providers/psr/http-factory-implementation).\n\nAlternatively, you can use any other implementation of these interfaces such as Guzzle.\n\n### Applications that don't use Symfony Flex\n\n#### Step 1: Download the Bundle\n\nOpen a command console, enter your project directory and execute the\nfollowing command to download the latest stable version of this bundle:\n\n```console\n$ composer require dunglas/digital-ocean-bundle symfony/http-client nyholm/psr7 guzzlehttp/promises\n```\n\n#### Step 2: Enable the Bundle\n\nThen, enable the bundle by adding it to the list of registered bundles\nin the `config/bundles.php` file of your project:\n\n```php\n// config/bundles.php\n\nreturn [\n    // ...\n    \\Dunglas\\DigitalOceanBundle\\DunglasDigitalOceanBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\n## Configuration\n\n```yaml\ndunglas_digital_ocean:\n    connections:\n        primary: # can be any name\n            token: \u003cyour-access-token\u003e\n        secondary:\n            token: \u003cyour-access-token\u003e\n    default_connection: primary # If not set, the first in the list will be used\n```\n\nThis configuration automatically registers the following autowiring aliases:\n\n```\nDigitalOceanV2\\Client $primaryClient\nDigitalOceanV2\\Client $secondaryClient\n```\n\nIf you have only one client, you can use this shortcut:\n\n```yaml\ndunglas_digital_ocean: \u003cyour-access-token\u003e\n```\n\nUse the `DigitalOceanV2\\Client` type to inject the default DigitalOcean client.\n\n## Credits\n\nThis bundle is brought to you by [Kévin Dunglas](https://dunglas.fr).\nIt is sponsored by [Les-Tilleuls.coop](https://les-tilleuls.coop).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdunglas%2FDunglasDigitalOceanBundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdunglas%2FDunglasDigitalOceanBundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdunglas%2FDunglasDigitalOceanBundle/lists"}