Files
ladill-hosting/app/Services/Hosting/PanelRuntimeResolver.php
T
isaaccladandCursor e251a4cf60
Deploy Ladill Hosting / deploy (push) Failing after 17s
Initial Ladill Hosting app with Gitea deploy pipeline.
Shared web hosting extracted from the platform monolith, with CI deploy
to /var/www/ladill-hosting matching Bird/Domains/Email.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 16:24:20 +00:00

31 lines
878 B
PHP

<?php
namespace App\Services\Hosting;
use App\Models\CustomerHostingOrder;
use App\Models\HostingAccount;
use App\Services\Hosting\Contracts\PanelRuntimeInterface;
use App\Services\Hosting\PanelRuntimes\SharedHostingPanelRuntime;
use InvalidArgumentException;
use RuntimeException;
class PanelRuntimeResolver
{
public function __construct(
private SharedHostingPanelRuntime $sharedHostingRuntime,
) {}
public function forSubject(mixed $subject): PanelRuntimeInterface
{
if ($subject instanceof HostingAccount) {
return $this->sharedHostingRuntime;
}
if ($subject instanceof CustomerHostingOrder) {
throw new RuntimeException('Server-backed hosting panel runtime is not enabled yet for this order.');
}
throw new InvalidArgumentException('Unsupported panel runtime subject.');
}
}