update fix deadcode, security
This commit is contained in:
@@ -58,27 +58,11 @@ class Invoice extends Model
|
||||
return $this->belongsTo(Service::class, 'service_id');
|
||||
}
|
||||
|
||||
|
||||
public function payment()
|
||||
{
|
||||
return $this->belongsTo(Payment::class, 'payment_method', 'id');
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Helpers
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
public function getStatus(): string
|
||||
{
|
||||
return match ($this->status) {
|
||||
1 => '<span class="bg-red-100 text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded-sm dark:bg-red-900 dark:text-red-300">Chưa thanh toán</span>',
|
||||
2 => '<span class="bg-lime-100 text-lime-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded-sm dark:bg-lime-900 dark:text-lime-300">Đã thanh toán</span>',
|
||||
3 => '<span class="bg-gray-100 text-gray-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded-sm dark:bg-gray-900 dark:text-gray-300">Đã hủy</span>',
|
||||
4 => '<span class="bg-orange-100 text-orange-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded-sm dark:bg-orange-900 dark:text-orange-300">Quá hạn</span>',
|
||||
default => '<span class="bg-red-100 text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded-sm dark:bg-red-900 dark:text-red-300">Không xác định</span>',
|
||||
};
|
||||
}
|
||||
|
||||
public function getStatusLabelAttribute(): string
|
||||
{
|
||||
return InvoiceStatus::from($this->status)->label();
|
||||
|
||||
Reference in New Issue
Block a user