Hide fulfilled pending-setup orders from the customer hosting list.
Deploy Ladill Hosting / deploy (push) Successful in 45s

Sales Centre left Active CustomerHostingOrder rows with pending-setup.local alongside real HostingAccounts, so customers saw two hostings.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-13 17:10:49 +00:00
co-authored by Cursor
parent bc199ccb43
commit b7f320ca30
5 changed files with 200 additions and 7 deletions
+15 -2
View File
@@ -12,6 +12,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Schema;
use App\Services\Hosting\PlaceholderPrimaryDomainService;
class HostingAccount extends Model
{
@@ -139,7 +140,15 @@ class HostingAccount extends Model
public function linkedDomainLabel(): ?string
{
if ($this->relationLoaded('sites') && $this->sites->isNotEmpty()) {
$domains = $this->sites->pluck('domain')->filter()->unique()->values();
$domains = $this->sites
->pluck('domain')
->filter(fn ($domain) => filled($domain) && ! PlaceholderPrimaryDomainService::isPlaceholderDomain((string) $domain))
->unique()
->values();
if ($domains->isEmpty()) {
return null;
}
if ($domains->count() === 1) {
return (string) $domains->first();
@@ -152,7 +161,11 @@ class HostingAccount extends Model
: $preview;
}
return filled($this->primary_domain) ? (string) $this->primary_domain : null;
if (filled($this->primary_domain) && ! PlaceholderPrimaryDomainService::isPlaceholderDomain($this->primary_domain)) {
return (string) $this->primary_domain;
}
return null;
}
public function databases(): HasMany