Implements ProvisioningServiceInterface for game servers via Pterodactyl panel API. Supports create, suspend, unsuspend, terminate, status, and credential retrieval. Auto-creates panel user accounts. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
25 lines
673 B
PHP
25 lines
673 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Services\Provisioning;
|
|
|
|
use InvalidArgumentException;
|
|
|
|
class ProvisioningFactory
|
|
{
|
|
/**
|
|
* Create a provisioning service instance based on service type.
|
|
*/
|
|
public function make(string $serviceType): ProvisioningServiceInterface
|
|
{
|
|
return match ($serviceType) {
|
|
'vps' => app(VirtFusionService::class),
|
|
'dedicated' => app(SynergyCPService::class),
|
|
'hosting' => app(EnhanceService::class),
|
|
'game' => app(PterodactylService::class),
|
|
default => throw new InvalidArgumentException("Unsupported service type: {$serviceType}"),
|
|
};
|
|
}
|
|
}
|