Files
star-cloud/app/Models/Machine/RemoteCommand.php
sky121113 d2131aaf06
All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 1m2s
feat: Implement Remote Management Command Center with unified UI and B010/B017 integration
2026-04-01 16:50:37 +08:00

39 lines
726 B
PHP

<?php
namespace App\Models\Machine;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class RemoteCommand extends Model
{
use HasFactory;
protected $fillable = [
'machine_id',
'command_type',
'payload',
'status',
'ttl',
'executed_at',
];
protected $casts = [
'payload' => 'array',
'executed_at' => 'datetime',
];
public function machine()
{
return $this->belongsTo(Machine::class);
}
/**
* Scope for pending commands
*/
public function scopePending($query)
{
return $query->where('status', 'pending')->orderBy('created_at', 'asc');
}
}