Hide fulfilled pending-setup orders from the customer hosting list.
Deploy Ladill Hosting / deploy (push) Successful in 45s
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user