arrayable enums, only use base ubuntu images, server controller tests, server frontend page fixes
This commit is contained in:
14
app/Enums/Concerns/Arrayable.php
Normal file
14
app/Enums/Concerns/Arrayable.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums\Concerns;
|
||||
|
||||
trait Arrayable
|
||||
{
|
||||
public static function toArray(): array
|
||||
{
|
||||
$names = array_column(self::cases(), 'name');
|
||||
$values = array_column(self::cases(), 'value');
|
||||
|
||||
return array_combine($names, $values);
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use App\Enums\Concerns\Arrayable;
|
||||
|
||||
enum DeploymentStatus: string
|
||||
{
|
||||
use Arrayable;
|
||||
|
||||
case PENDING = 'pending';
|
||||
case IN_PROGRESS = 'in-progress';
|
||||
case COMPLETED = 'completed';
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use App\Enums\Concerns\Arrayable;
|
||||
|
||||
enum FirewallRuleStatus: string
|
||||
{
|
||||
use Arrayable;
|
||||
|
||||
case NOT_APPLIED = 'not-applied';
|
||||
case APPLIED = 'applied';
|
||||
case FAILED = 'failed';
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use App\Enums\Concerns\Arrayable;
|
||||
|
||||
enum OrganisationRole: string
|
||||
{
|
||||
use Arrayable;
|
||||
|
||||
case ADMIN = 'admin';
|
||||
case MEMBER = 'member';
|
||||
}
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use App\Enums\Concerns\Arrayable;
|
||||
|
||||
enum RepositoryType: string
|
||||
{
|
||||
use Arrayable;
|
||||
|
||||
case GIT = 'git';
|
||||
}
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use App\Enums\Concerns\Arrayable;
|
||||
|
||||
enum ServerProvider: string
|
||||
{
|
||||
use Arrayable;
|
||||
|
||||
case HETZNER = 'hetzner';
|
||||
case DIGITAL_OCEAN = 'digital-ocean';
|
||||
}
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use App\Enums\Concerns\Arrayable;
|
||||
|
||||
enum ServerStatus: string
|
||||
{
|
||||
use Arrayable;
|
||||
|
||||
case WAITING_FOR_PROVIDER = 'waiting-for-provider';
|
||||
case PROVIDER_TIMEOUT = 'provider-timeout';
|
||||
case UNPROVISIONED = 'unprovisioned';
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use App\Enums\Concerns\Arrayable;
|
||||
|
||||
enum ServiceCategory: string
|
||||
{
|
||||
use Arrayable;
|
||||
|
||||
case DATABASE = 'database';
|
||||
case APPLICATION = 'application';
|
||||
case GATEWAY = 'gateway';
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use App\Enums\Concerns\Arrayable;
|
||||
|
||||
enum ServiceStatus: string
|
||||
{
|
||||
use Arrayable;
|
||||
|
||||
case NOT_INSTALLED = 'not-installed';
|
||||
case INSTALLING = 'installing';
|
||||
case RUNNING = 'running';
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use App\Enums\Concerns\Arrayable;
|
||||
|
||||
enum ServiceType: string {
|
||||
use Arrayable;
|
||||
|
||||
case FRANKENPHP = 'frankenphp';
|
||||
case PHP_FPM = 'php-fpm';
|
||||
case POSTGRES = 'postgres';
|
||||
|
||||
Reference in New Issue
Block a user