Refactor code structure for improved readability and maintainability

This commit is contained in:
baodev0
2026-08-10 08:37:52 +07:00
parent d6d63e5152
commit e3d3dea8aa
31 changed files with 290 additions and 319 deletions
@@ -8,6 +8,8 @@ use Illuminate\Http\Resources\Json\JsonResource;
class InvoiceDetailResource extends JsonResource
{
use ResolvesPaymentMethod;
public function toArray(Request $request): array
{
return [
@@ -20,7 +22,7 @@ class InvoiceDetailResource extends JsonResource
'discount_amount' => (float) ($this->discount_amount ?? 0),
'tax' => (float) $this->tax,
'total' => (float) $this->total,
'payment_method' => $this->payment_method,
'payment_method' => $this->resolvePaymentMethod($this->resource),
'auto_renew' => (bool) $this->auto_renew,
'created_at' => $this->created_at?->toISOString(),
'due_date' => $this->due_date?->toISOString(),