VPS and dedicated server ordering, managed panels, SSO, billing, and launcher integration — forked from hosting infrastructure with server-focused routes and dashboard. Co-authored-by: Cursor <cursoragent@cursor.com>
61 lines
1.4 KiB
PHP
61 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class ServerSite extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'customer_hosting_order_id',
|
|
'server_agent_id',
|
|
'latest_server_task_id',
|
|
'domain_id',
|
|
'domain',
|
|
'document_root',
|
|
'php_version',
|
|
'php_socket',
|
|
'status',
|
|
'ssl_status',
|
|
'ssl_provisioned_at',
|
|
'ssl_expires_at',
|
|
'metadata',
|
|
];
|
|
|
|
protected $casts = [
|
|
'metadata' => 'array',
|
|
'ssl_provisioned_at' => 'datetime',
|
|
'ssl_expires_at' => 'datetime',
|
|
];
|
|
|
|
public function order(): BelongsTo
|
|
{
|
|
return $this->belongsTo(CustomerHostingOrder::class, 'customer_hosting_order_id');
|
|
}
|
|
|
|
public function agent(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ServerAgent::class, 'server_agent_id');
|
|
}
|
|
|
|
public function latestTask(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ServerTask::class, 'latest_server_task_id');
|
|
}
|
|
|
|
public function domainModel(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Domain::class, 'domain_id');
|
|
}
|
|
|
|
public function databases(): HasMany
|
|
{
|
|
return $this->hasMany(ServerDatabase::class);
|
|
}
|
|
}
|