Files
alrahma_sunday_school_api/app/Http/Resources/Fees/FeeRefundResource.php
T
2026-03-09 16:02:30 -04:00

22 lines
742 B
PHP

<?php
namespace App\Http\Resources\Fees;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class FeeRefundResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'refund_amount' => (float) ($this->resource['refund_amount'] ?? 0),
'total_paid' => (float) ($this->resource['total_paid'] ?? 0),
'refund_deadline' => $this->resource['refund_deadline'] ?? null,
'school_end_date' => $this->resource['school_end_date'] ?? null,
'weeks_of_study' => (float) ($this->resource['weeks_of_study'] ?? 0),
'withdrawn_students' => (int) ($this->resource['withdrawn_students'] ?? 0),
];
}
}