- 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>
34 lines
760 B
PHP
34 lines
760 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class ServiceAttachment extends Model
|
|
{
|
|
public const UPLOAD_RULE = 'required|file|mimes:jpg,jpeg,png,gif,webp,pdf,doc,docx,xls,xlsx,zip|max:51200';
|
|
|
|
public const AUDIENCE_ADMIN = 'admin';
|
|
public const AUDIENCE_CUSTOMER = 'customer';
|
|
|
|
protected $guarded = [];
|
|
|
|
protected $appends = ['url'];
|
|
|
|
public function scopeForCustomer($query)
|
|
{
|
|
return $query->where('audience', self::AUDIENCE_CUSTOMER);
|
|
}
|
|
|
|
public function service()
|
|
{
|
|
return $this->belongsTo(Service::class);
|
|
}
|
|
|
|
public function getUrlAttribute(): string
|
|
{
|
|
return Storage::disk($this->disk)->url($this->path);
|
|
}
|
|
}
|