UnitAccountPayableResource.php 1.1 KB

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Http\Resources;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Http\Resources\Json\JsonResource;
  5. class UnitAccountPayableResource extends JsonResource
  6. {
  7. public function toArray(Request $request): array
  8. {
  9. return [
  10. 'id' => $this->id,
  11. 'origin' => $this->origin,
  12. 'franchisee_account_receive_id' => $this->franchisee_account_receive_id,
  13. 'history' => $this->history,
  14. 'value' => (float) $this->value,
  15. 'paid_value' => (float) $this->paid_value,
  16. 'discount' => (float) $this->discount,
  17. 'fine' => (float) $this->fine,
  18. 'due_date' => $this->due_date?->format('Y-m-d'),
  19. 'payment_date' => $this->payment_date?->format('Y-m-d'),
  20. 'status' => $this->status,
  21. 'obs' => $this->obs,
  22. ];
  23. }
  24. }