server creation wip

This commit is contained in:
2025-03-28 17:10:36 +00:00
parent 7d2bc3ca5e
commit 350cf6e240
16 changed files with 3180 additions and 30 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions;
class GenerateRandomSlug
{
public function execute($adjectiveCount = 1): string
{
$adjectives = explode("\n", file_get_contents(resource_path('text/english-adjectives.txt')));
$nouns = explode("\n", file_get_contents(resource_path('text/english-nouns.txt')));
$slug = '';
for ($i = 0; $i < $adjectiveCount; $i++) {
$slug .= $adjectives[array_rand($adjectives)] . '-';
}
$slug .= $nouns[array_rand($nouns)];
return $slug;
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Actions;
use App\Services\ServerProviders\HetznerService;
use App\Services\ServerProviders\ServerProviderService;
class GetProviderService
{
public function execute(string $provider): ServerProviderService|null
{
return match ($provider) {
'hetzner' => new HetznerService(),
default => null,
};
}
}