This commit is contained in:
2025-04-07 14:47:39 +01:00
parent b800a9d83a
commit 7f546c1678
9 changed files with 23 additions and 42 deletions

View File

@@ -3,6 +3,8 @@
namespace App\Models;
use App\Enums\ProviderType;
use App\Services\ServerProviders\HetznerService;
use App\Services\ServerProviders\ServerProviderService;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
@@ -27,4 +29,12 @@ class Provider extends Model
{
return $this->hasMany(Server::class);
}
public function service(): ?ServerProviderService
{
return match ($this->type) {
ProviderType::HETZNER => new HetznerService($this),
default => null,
};
}
}