Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user