'boolean', 'is_default' => 'boolean', 'dns_verified_at' => 'datetime', 'ssl_issued_at' => 'datetime', 'ssl_expires_at' => 'datetime', ]; } public function user(): BelongsTo { return $this->belongsTo(User::class); } public function isLive(): bool { return $this->status === self::STATUS_ACTIVE && $this->ssl_status === self::STATUS_ACTIVE; } public function baseUrl(): string { return 'https://'.$this->host; } protected static function booted(): void { static::saving(function (LinkCustomDomain $domain) { $domain->host = strtolower(trim((string) $domain->host, " \t\n\r\0\x0B./")); $domain->host = preg_replace('/^www\./', '', $domain->host) ?: $domain->host; }); } }