PHPackages                             sinnrrr/php-diia-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sinnrrr/php-diia-sdk

AbandonedArchivedLibrary[API Development](/categories/api)

sinnrrr/php-diia-sdk
====================

PHP Diia SDK

0381PHP

Since Aug 11Pushed 4y ago1 watchersCompare

[ Source](https://github.com/sinnrrr/php-diia-sdk)[ Packagist](https://packagist.org/packages/sinnrrr/php-diia-sdk)[ RSS](/packages/sinnrrr-php-diia-sdk/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Diia SDK
============

[](#php-diia-sdk)

[![Total Downloads](https://camo.githubusercontent.com/44d23fa166b79f412fa3f574d951c9b62e170c198e1ef6d6ad0106d17822f242/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73696e6e7272722f7068702d646969612d73646b)](https://packagist.org/packages/sinnrrr/php-laravel-diia)[![Latest Stable Version](https://camo.githubusercontent.com/d18c26e05ce65a0b64437b76097925bdf784c8019023ea3d362b8269c43741f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e6e7272722f7068702d646969612d73646b)](https://packagist.org/packages/sinnrrr/php-laravel-diia)[![License](https://camo.githubusercontent.com/cdd113c9cf83b5e67e94c5f62e0f9b214f399d923a40772d556efaa16d5806f7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73696e6e7272722f7068702d646969612d73646b)](https://packagist.org/packages/sinnrrr/php-laravel-diia)

Introduction
------------

[](#introduction)

The [Diia](https://id.gov.ua/) SDK provides an expressive interface for interacting with [id.gov.ua](https://id.gov.ua/) API and managing branches &amp; offers.

Documentation
-------------

[](#documentation)

### Installation

[](#installation)

To install the SDK in your project you need to require the package via composer:

```
composer require sinnrrr/php-diia-sdk
```

### Basic Usage

[](#basic-usage)

You can create an instance of the SDK like so:

```
$diia = new Sinnrrr\Diia\Diia(TOKEN_HERE);
```

Using the `Diia` instance you may perform multiple actions as well as retrieve the different resources Diia's API provides:

```
$branches = $diia->branches();
```

This will give you an array of branches that you have access to, where each branch is represented by an instance of `Sinnrrr\Diia\Resources\Branch`, this instance has multiple public properties like `$name`, `$email`, `$region`, `$scopes`, and others.

You may also retrieve a single branch using:

```
$branch = $diia->branch(BRANCH_ID_HERE);
```

On multiple actions supported by this SDK you may need to pass some parameters, for example when creating a new server:

```
$server = $diia->createServer([
    "provider"=> ServerProviders::DIGITAL_OCEAN,
    "credential_id"=> 1,
    "name"=> "test-via-api",
    "type"=> ServerTypes::APP,
    "size"=> "01",
    "database"=> "test123",
    "database_type" => InstallableServices::POSTGRES,
    "php_version"=> InstallableServices::PHP_71,
    "region"=> "ams2"
]);
```

These parameters will be used in the POST request sent to Forge servers, you can find more information about the parameters needed for each action on [Forge's official API documentation](https://forge.laravel.com/api-documentation).

Notice that this request for example will only start the server creation process, your server might need a few minutes before it completes provisioning, you'll need to check the server's `$isReady` property to know if it's ready or not yet.

Some SDK methods however waits for the action to complete on Forge's end, we do this by periodically contacting Forge servers and checking if our action has completed, for example:

```
$diia->createSite(SERVER_ID, [SITE_PARAMETERS]);
```

This method will ping Forge servers every 5 seconds and see if the newly created Site's status is `installed` and only return when it's so, in case the waiting exceeded 30 seconds a `Laravel\Forge\Exceptions\TimeoutException` will be thrown.

You can easily stop this behaviour be setting the `$wait` argument to false:

```
$diia->createSite(SERVER_ID, [SITE_PARAMETERS], false);
```

You can also set the desired timeout value:

```
$diia->setTimeout(120)->createSite(SERVER_ID, [SITE_PARAMETERS]);
```

### Authenticated User

[](#authenticated-user)

```
$diia->user();
```

### Managing Servers

[](#managing-servers)

```
$diia->servers();
$diia->server($serverId);
$diia->createServer(array $data);
$diia->updateServer($serverId, array $data);
$diia->deleteServer($serverId);
$diia->rebootServer($serverId);

// Server access
$diia->revokeAccessToServer($serverId);
$diia->reconnectToServer($serverId);
$diia->reactivateToServer($serverId);
```

On a `Server` instance you may also call:

```
$server->update(array $data);
$server->delete();
$server->reboot();
$server->revokeAccess();
$server->reconnect();
$server->reactivate();
$server->rebootMysql();
$server->stopMysql();
$server->rebootPostgres();
$server->stopPostgres();
$server->rebootNginx();
$server->stopNginx();
$server->installBlackfire(array $data);
$server->removeBlackfire();
$server->installPapertrail(array $data);
$server->removePapertrail();
$server->enableOPCache();
$server->disableOPCache();
$server->phpVersions();
$server->installPHP($version);
$server->updatePHP($version);
```

### Server SSH Keys

[](#server-ssh-keys)

```
$diia->keys($serverId);
$diia->sshKey($serverId, $keyId);
$diia->createSSHKey($serverId, array $data, $wait = true);
$diia->deleteSSHKey($serverId, $keyId);
```

On a `SSHKey` instance you may also call:

```
$sshKey->delete();
```

### Server Scheduled Jobs

[](#server-scheduled-jobs)

```
$diia->jobs($serverId);
$diia->job($serverId, $jobId);
$diia->createJob($serverId, array $data, $wait = true);
$diia->deleteJob($serverId, $jobId);
```

On a `Job` instance you may also call:

```
$job->delete();
```

### Server Events

[](#server-events)

```
$diia->events();
$diia->events($serverId);
```

### Managing Services

[](#managing-services)

```
// MySQL
$diia->rebootMysql($serverId);
$diia->stopMysql($serverId);

// Postgres
$diia->rebootPostgres($serverId);
$diia->stopPostgres($serverId);

// Nginx
$diia->rebootNginx($serverId);
$diia->stopNginx($serverId);
$diia->siteNginxFile($serverId, $siteId);
$diia->updateSiteNginxFile($serverId, $siteId, $content);

// Blackfire
$diia->installBlackfire($serverId, array $data);
$diia->removeBlackfire($serverId);

// Papertrail
$diia->installPapertrail($serverId, array $data);
$diia->removePapertrail($serverId);

// OPCache
$diia->enableOPCache($serverId);
$diia->disableOPCache($serverId);
```

### Server Daemons

[](#server-daemons)

```
$diia->daemons($serverId);
$diia->daemon($serverId, $daemonId);
$diia->createDaemon($serverId, array $data, $wait = true);
$diia->restartDaemon($serverId, $daemonId, $wait = true);
$diia->deleteDaemon($serverId, $daemonId);
```

On a `Daemon` instance you may also call:

```
$daemon->restart($wait = true);
$daemon->delete();
```

### Server Firewall Rules

[](#server-firewall-rules)

```
$diia->firewallRules($serverId);
$diia->firewallRule($serverId, $ruleId);
$diia->createFirewallRule($serverId, array $data, $wait = true);
$diia->deleteFirewallRule($serverId, $ruleId);
```

On a `FirewallRule` instance you may also call:

```
$rule->delete();
```

### Managing Sites

[](#managing-sites)

```
$diia->sites($serverId);
$diia->site($serverId, $siteId);
$diia->createSite($serverId, array $data, $wait = true);
$diia->updateSite($serverId, $siteId, array $data);
$diia->refreshSiteToken($serverId, $siteId);
$diia->deleteSite($serverId, $siteId);

// Add Site Aliases
$diia->addSiteAliases($serverId, $siteId, array $aliases);

// Environment File
$diia->siteEnvironmentFile($serverId, $siteId);
$diia->updateSiteEnvironmentFile($serverId, $siteId, $content);

// Site Repositories and Deployments
$diia->installGitRepositoryOnSite($serverId, $siteId, array $data, $wait = false);
$diia->updateSiteGitRepository($serverId, $siteId, array $data);
$diia->destroySiteGitRepository($serverId, $siteId, $wait = false);
$diia->siteDeploymentScript($serverId, $siteId);
$diia->updateSiteDeploymentScript($serverId, $siteId, $content);
$diia->enableQuickDeploy($serverId, $siteId);
$diia->disableQuickDeploy($serverId, $siteId);
$diia->deploySite($serverId, $siteId, $wait = false);
$diia->resetDeploymentState($serverId, $siteId);
$diia->siteDeploymentLog($serverId, $siteId);

// PHP Version
$diia->changeSitePHPVersion($serverId, $siteId, $version);

// Installing Wordpress
$diia->installWordPress($serverId, $siteId, array $data);
$diia->removeWordPress($serverId, $siteId);

// Installing phpMyAdmin
$diia->installPhpMyAdmin($serverId, $siteId, array $data);
$diia->removePhpMyAdmin($serverId, $siteId);

// Updating Node balancing Configuration
$diia->updateNodeBalancingConfiguration($serverId, $siteId, array $data);
```

On a `Site` instance you may also call:

```
$site->refreshToken();
$site->delete();
$site->installGitRepository(array $data, $wait = false);
$site->updateGitRepository(array $data);
$site->destroyGitRepository($wait = false);
$site->getDeploymentScript();
$site->updateDeploymentScript($content);
$site->enableQuickDeploy();
$site->disableQuickDeploy();
$site->deploySite($wait = false);
$site->resetDeploymentState();
$site->siteDeploymentLog();
$site->installWordPress($data);
$site->removeWordPress();
$site->installPhpMyAdmin($data);
$site->removePhpMyAdmin();
$site->changePHPVersion($version);
```

### Site Workers

[](#site-workers)

```
$diia->workers($serverId, $siteId);
$diia->worker($serverId, $siteId, $workerId);
$diia->createWorker($serverId, $siteId, array $data, $wait = true);
$diia->deleteWorker($serverId, $siteId, $workerId);
$diia->restartWorker($serverId, $siteId, $workerId, $wait = true);
```

On a `Worker` instance you may also call:

```
$worker->delete();
$worker->restart($wait = true);
```

### Security Rules

[](#security-rules)

```
$diia->securityRules($serverId, $siteId);
$diia->securityRule($serverId, $siteId, $ruleId);
$diia->createSecurityRule($serverId, $siteId, array $data);
$diia->deleteSecurityRule($serverId, $siteId, $ruleId);
```

On a `SecurityRule` instance you may also call:

```
$securityRule->delete();
```

### Site Webhooks

[](#site-webhooks)

```
$diia->webhooks($serverId, $siteId);
$diia->webhook($serverId, $siteId, $webhookId);
$diia->createWebhook($serverId, $siteId, array $data);
$diia->deleteWebhook($serverId, $siteId, $webhookId);
```

On a `Webhook` instance you may also call:

```
$webhook->delete();
```

### Site Commands

[](#site-commands)

```
$diia->executeSiteCommand($serverId, $siteId, array $data);
$diia->listCommandHistory($serverId, $siteId);
$diia->getSiteCommand($serverId, $siteId, $commandId);
```

### Site SSL Certificates

[](#site-ssl-certificates)

```
$diia->certificates($serverId, $siteId);
$diia->certificate($serverId, $siteId, $certificateId);
$diia->createCertificate($serverId, $siteId, array $data, $wait = true);
$diia->deleteCertificate($serverId, $siteId, $certificateId);
$diia->getCertificateSigningRequest($serverId, $siteId, $certificateId);
$diia->installCertificate($serverId, $siteId, $certificateId, array $data, $wait = true);
$diia->activateCertificate($serverId, $siteId, $certificateId, $wait = true);
$diia->obtainLetsEncryptCertificate($serverId, $siteId, $data, $wait = true);
```

On a `Certificate` instance you may also call:

```
$certificate->delete();
$certificate->getSigningRequest();
$certificate->install($wait = true);
$certificate->activate($wait = true);
```

### Nginx Templates

[](#nginx-templates)

```
$diia->nginxTemplates($serverId);
$diia->nginxDefaultTemplate($serverId);
$diia->nginxTemplate($serverId, $templateId);
$diia->createNginxTemplate($serverId, array $data);
$diia->updateNginxTemplate($serverId, $templateId, array $data);
$diia->deleteNginxTemplate($serverId, $templateId);
```

On a `NginxTemplate` instance you may also call:

```
$nginxTemplate->update(array $data);
$nginxTemplate->delete();
```

### Managing Databases

[](#managing-databases)

```
$diia->databases($serverId);
$diia->database($serverId, $databaseId);
$diia->createDatabase($serverId, array $data, $wait = true);
$diia->updateDatabase($serverId, $databaseId, array $data);
$diia->deleteDatabase($serverId, $databaseId);

// Users
$diia->databaseUsers($serverId);
$diia->databaseUser($serverId, $userId);
$diia->createDatabaseUser($serverId, array $data, $wait = true);
$diia->updateDatabaseUser($serverId, $userId, array $data);
$diia->deleteDatabaseUser($serverId, $userId);
```

On a `Database` instance you may also call:

```
$database->update(array $data);
$database->delete();
```

On a `DatabaseUser` instance you may also call:

```
$databaseUser->update(array $data);
$databaseUser->delete();
```

### Managing Recipes

[](#managing-recipes)

```
$diia->recipes();
$diia->recipe($recipeId);
$diia->createRecipe(array $data);
$diia->updateRecipe($recipeId, array $data);
$diia->deleteRecipe($recipeId);
$diia->runRecipe($recipeId, array $data);
```

On a `Recipe` instance you may also call:

```
$recipe->update(array $data);
$recipe->delete();
$recipe->run(array $data);
```

### Managing Backups

[](#managing-backups)

```
$diia->backupConfigurations($serverId);
$diia->createBackupConfiguration($serverId, array $data);
$diia->updateBackupConfiguration($serverId, $backupConfigurationId, array $data);
$diia->backupConfiguration($serverId, $backupConfigurationId);
$diia->deleteBackupConfiguration($serverId, $backupConfigurationId);
$diia->restoreBackup($serverId, $backupConfigurationId, $backupId);
$diia->deleteBackup($serverId, $backupConfigurationId, $backupId);
```

On a `BackupConfiguration` instance you may also call:

```
$extendedConfig = $backupConfig->get(); // Load the databases also
$backupConfig->update(array $data);
$backupConfig->delete();
$backupConfig->restoreBackup($backupId);
$backupConfig->deleteBackup($backupId);
```

On a `Backup` instance you may also call:

```
$backupConfig->delete();
$backupConfig->restore();
```

Contributing
------------

[](#contributing)

Thank you for considering contributing to Forge SDK! You can read the contribution guide [here](.github/CONTRIBUTING.md).

Code of Conduct
---------------

[](#code-of-conduct)

In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](https://github.com/laravel/forge-sdk/security/policy) on how to report security vulnerabilities.

License
-------

[](#license)

Laravel Forge SDK is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/74b2d6c578455944f4ff537bdee915019cd03d88b180bac0087c8f73e3775431?d=identicon)[sinnrrr](/maintainers/sinnrrr)

---

Top Contributors

[![sinnrrr](https://avatars.githubusercontent.com/u/25615887?v=4)](https://github.com/sinnrrr "sinnrrr (50 commits)")

---

Tags

apilaravelphpsdksymfonywrapperyii

### Embed Badge

![Health badge](/badges/sinnrrr-php-diia-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/sinnrrr-php-diia-sdk/health.svg)](https://phpackages.com/packages/sinnrrr-php-diia-sdk)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
