From 826865bbe105c90521d33b6fea544470c3fbbec5 Mon Sep 17 00:00:00 2001 From: Mehran Rasulian Date: Mon, 16 Jun 2025 12:26:08 +0400 Subject: [PATCH] fix explode() null argument error in getFormattedAliases --- app/Services/Forge/ForgeService.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Services/Forge/ForgeService.php b/app/Services/Forge/ForgeService.php index b548b76..62d569c 100644 --- a/app/Services/Forge/ForgeService.php +++ b/app/Services/Forge/ForgeService.php @@ -83,9 +83,13 @@ public function getFormattedDomainName(): string public function getFormattedAliases(): array { - $subdomain = $this->setting->subdomainName ?? $this->getFormattedBranchName(); + if ($this->setting->aliases === null) { + return []; + } - return collect(explode(',', $this->setting->aliases) ?? []) + $subdomain = $this->setting->subdomainName ?? $this->getFormattedBranchName(); + + return collect(explode(',', $this->setting->aliases)) ->map(fn($alias) => GenerateDomainName::run(trim($alias), $subdomain)) ->toArray(); }