'datetime', 'completed_at' => 'datetime', 'password_supplied_by_customer' => 'boolean', ]; public const PRODUCT_TYPE_VPS = 4; public const STATUS_PENDING = 'pending'; public const STATUS_IN_PROGRESS = 'in_progress'; public const STATUS_COMPLETED = 'completed'; public const STATUS_FAILED = 'failed'; public function customer() { return $this->belongsTo(Customer::class, 'custome_id'); } public function service() { return $this->belongsTo(Service::class, 'service_id'); } public function vm() { return $this->belongsTo(ModuleVmware::class, 'product_id'); } public function os() { return $this->belongsTo(Os::class, 'os_id'); } /** Decrypt the password column on demand (null if not yet set). */ public function decryptedPassword(): ?string { if (!$this->password) { return $this->plain_password ?: null; } try { return SignRSA::DecryptFunc($this->password); } catch (\Throwable $e) { return $this->plain_password ?: null; } } }