Files
isaaccladandCursor e251a4cf60
Deploy Ladill Hosting / deploy (push) Failing after 17s
Initial Ladill Hosting app with Gitea deploy pipeline.
Shared web hosting extracted from the platform monolith, with CI deploy
to /var/www/ladill-hosting matching Bird/Domains/Email.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 16:24:20 +00:00

73 lines
1.5 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
class VpsInstance extends Model
{
use SoftDeletes;
protected $fillable = [
'user_id',
'hosting_plan_id',
'name',
'hostname',
'provider',
'provider_instance_id',
'ip_address',
'ipv6_address',
'region',
'datacenter',
'image',
'cpu_cores',
'ram_mb',
'disk_gb',
'status',
'power_status',
'root_password_encrypted',
'ssh_public_key',
'tags',
'metadata',
'provisioned_at',
'expires_at',
];
protected $casts = [
'tags' => 'array',
'metadata' => 'array',
'provisioned_at' => 'datetime',
'expires_at' => 'datetime',
];
protected $hidden = ['root_password_encrypted'];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function plan(): BelongsTo
{
return $this->belongsTo(HostingPlan::class, 'hosting_plan_id');
}
public function snapshots(): HasMany
{
return $this->hasMany(VpsSnapshot::class);
}
public function isRunning(): bool
{
return $this->status === 'running';
}
public function scopeRunning($query)
{
return $query->where('status', 'running');
}
}