| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace App\Http\Resources;
- use Illuminate\Http\Request;
- use Illuminate\Http\Resources\Json\JsonResource;
- class UnitReceivableResource extends JsonResource
- {
- public function toArray(Request $request): array
- {
- return [
- 'id' => $this->id,
- 'student_contract_id' => $this->student_contract_id,
- 'student_id' => $this->student_id,
- 'student_name' => $this->student?->name,
- 'type' => $this->type,
- 'history' => $this->history,
- 'installment_number' => $this->installment_number,
- 'total_installments' => $this->total_installments,
- 'order' => $this->order,
- 'value' => (float) $this->value,
- 'paid_value' => (float) $this->paid_value,
- 'discount' => (float) $this->discount,
- 'fine' => (float) $this->fine,
- 'due_date' => $this->due_date?->format('Y-m-d'),
- 'payment_date' => $this->payment_date?->format('Y-m-d'),
- 'status' => $this->status,
- 'asaas_id' => $this->asaas_id,
- 'invoice_url' => $this->invoice_url,
- 'billing_type' => $this->billing_type,
- 'asaas_status' => $this->asaas_status,
- ];
- }
- }
|