Skip to content

Commit

Permalink
Merge pull request #94 from VictorAvelar/helpers-classes-for-known-va…
Browse files Browse the repository at this point in the history
…lues

[3.x] Forge defaults as class constants
  • Loading branch information
jbrooksuk authored Sep 18, 2020
2 parents 950e2fd + 576d532 commit f3c91f3
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ On multiple actions supported by this SDK you may need to pass some parameters,

```php
$server = $forge->createServer([
"provider"=> "ocean2",
"provider"=> ServerProviders::DIGITAL_OCEAN,
"credential_id"=> 1,
"name"=> "test-via-api",
"size"=> "01",
"database"=> "test123",
"php_version"=> "php71",
"database_type" => InstallableServices::POSTGRES,
"php_version"=> InstallableServices::PHP_71,
"region"=> "ams2"
]);
```
Expand Down
11 changes: 11 additions & 0 deletions src/Resources/GitProviders.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Laravel\Forge\Resources;

class GitProviders
{
const BITBUCKET = 'bitbucket';
const CUSTOM = 'custom';
const GITHUB = 'github';
const GITLAB = 'gitlab';
}
20 changes: 20 additions & 0 deletions src/Resources/InstallableServices.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Laravel\Forge\Resources;

class InstallableServices
{
const PHP_56 = 'php56';
const PHP_70 = 'php70';
const PHP_71 = 'php71';
const PHP_72 = 'php72';
const PHP_73 = 'php73';
const PHP_74 = 'php74';

const MYSQL = 'mysql';
const MYSQL_8 = 'mysql8';

const MARIADB = 'mariadb';

const POSTGRES = 'postgres';
}
10 changes: 10 additions & 0 deletions src/Resources/LoadBalancingStrategies.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Laravel\Forge\Resources;

class LoadBalancingStrategies
{
const ROUND_ROBIN = 'round_robin';
const LEAST_CONNECTIONS = 'least_conn';
const IP_HASH = 'ip_hash';
}
13 changes: 13 additions & 0 deletions src/Resources/ServerProviders.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Laravel\Forge\Resources;

class ServerProviders
{
const AWS = 'aws';
const CUSTOM = 'custom';
const DIGITAL_OCEAN = 'ocean2';
const HETZNER = 'hetzner';
const LINODE = 'linode';
const VULTR = 'vultr';
}

0 comments on commit f3c91f3

Please sign in to comment.