Show linked domains on cards and fix Email leftovers.
Deploy Ladill Hosting / deploy (push) Successful in 24s
Deploy Ladill Hosting / deploy (push) Successful in 24s
Display hosted_sites on account cards, scope Afia and Settings to hosting, add hosting_settings for notifications, and remove mailbox UI from the hosting layout and account pages. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -135,6 +135,26 @@ class HostingAccount extends Model
|
||||
return $this->hasMany(HostedSite::class);
|
||||
}
|
||||
|
||||
/** Primary label for UI lists — prefers linked hosted_sites over primary_domain. */
|
||||
public function linkedDomainLabel(): ?string
|
||||
{
|
||||
if ($this->relationLoaded('sites') && $this->sites->isNotEmpty()) {
|
||||
$domains = $this->sites->pluck('domain')->filter()->unique()->values();
|
||||
|
||||
if ($domains->count() === 1) {
|
||||
return (string) $domains->first();
|
||||
}
|
||||
|
||||
$preview = $domains->take(2)->implode(', ');
|
||||
|
||||
return $domains->count() > 2
|
||||
? "{$preview} +".($domains->count() - 2)
|
||||
: $preview;
|
||||
}
|
||||
|
||||
return filled($this->primary_domain) ? (string) $this->primary_domain : null;
|
||||
}
|
||||
|
||||
public function databases(): HasMany
|
||||
{
|
||||
return $this->hasMany(HostedDatabase::class);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/** Per-account hosting preferences (notifications, product updates). */
|
||||
class HostingSetting extends Model
|
||||
{
|
||||
protected $fillable = ['user_id', 'notify_email', 'product_updates'];
|
||||
|
||||
protected $casts = ['product_updates' => 'boolean'];
|
||||
}
|
||||
Reference in New Issue
Block a user