Files
baodev0andClaude Sonnet 5.5 b44a88bb52 feat(service): huỷ dịch vụ, SSL, đổi mật khẩu hosting, lịch sử thanh toán theo hình thức
- Lịch sử thanh toán hoá đơn trả thêm `method` (tự động gia hạn / số dư / admin / chuyển khoản / hoàn tiền), bỏ đuôi `(method)` khỏi ghi chú
- `DnsServer::panelUrl()` = https://<domain>/ dùng cho email cấp hosting và nút Plesk của khách
- Order item trả thêm `uuid`/`type` của dịch vụ để FE dẫn tới trang quản lý
- Yêu cầu huỷ dịch vụ, chứng chỉ SSL, lịch sử gia hạn, đổi mật khẩu hosting cho khách

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 16:40:24 +07:00

50 lines
1.0 KiB
PHP

<?php
namespace App\Models;
use App\Enums\Server\ServerType;
use App\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class DnsServer extends Model
{
use HasFactory, LogsActivity;
protected $table = 'dns_manager_servers';
protected $fillable = [
'name',
'ip_address',
'domain',
'panel_port',
'password',
'username',
'api_key',
'status',
'type',
];
public function servesHosting(): bool
{
$type = $this->attributes['type'] ?? ServerType::DOMAIN->value;
return in_array($type, [ServerType::HOSTING->value, ServerType::BOTH->value], true);
}
public function publicHost(): string
{
return $this->domain ?: $this->ip_address;
}
public function panelUrl(): string
{
return 'https://' . $this->publicHost() . '/';
}
protected function scopeIsActive($query)
{
return $query->where('status', 'activated');
}
}