feat(core): finally fqdn is fqdn and url is url. haha

This commit is contained in:
Andras Bacsai
2025-08-04 10:46:59 +02:00
parent e2518e53d9
commit e8892b3d29
10 changed files with 1159 additions and 1048 deletions

View File

@@ -111,7 +111,7 @@ class Application extends BaseModel
{
use HasConfiguration, HasFactory, SoftDeletes;
private static $parserVersion = '4';
private static $parserVersion = '5';
protected $guarded = [];
@@ -1442,7 +1442,21 @@ class Application extends BaseModel
$parsedServices = $this->parse();
if ($this->docker_compose_domains) {
$json = collect(json_decode($this->docker_compose_domains));
$names = collect(data_get($parsedServices, 'services'))->keys()->toArray();
foreach ($json as $key => $value) {
if (str($key)->contains('-')) {
$key = str($key)->replace('-', '_');
}
$json->put((string) $key, $value);
}
$services = collect(data_get($parsedServices, 'services', []));
foreach ($services as $name => $service) {
if (str($name)->contains('-')) {
$replacedName = str($name)->replace('-', '_');
$services->put((string) $replacedName, $service);
$services->forget((string) $name);
}
}
$names = collect($services)->keys()->toArray();
$jsonNames = $json->keys()->toArray();
$diff = array_diff($jsonNames, $names);
$json = $json->filter(function ($value, $key) use ($diff) {