add controllers, servoices

This commit is contained in:
root
2026-03-09 02:52:13 -04:00
parent c8de5f7edc
commit d76c871cb7
501 changed files with 34439 additions and 21843 deletions
@@ -0,0 +1,30 @@
<?php
namespace App\Http\Resources\Payments;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class PaymentResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => (int) ($this->resource['id'] ?? 0),
'parent_id' => (int) ($this->resource['parent_id'] ?? 0),
'invoice_id' => isset($this->resource['invoice_id']) ? (int) $this->resource['invoice_id'] : null,
'total_amount' => (float) ($this->resource['total_amount'] ?? 0),
'paid_amount' => (float) ($this->resource['paid_amount'] ?? 0),
'balance' => (float) ($this->resource['balance'] ?? 0),
'number_of_installments' => (int) ($this->resource['number_of_installments'] ?? 0),
'transaction_id' => $this->resource['transaction_id'] ?? null,
'payment_method' => $this->resource['payment_method'] ?? null,
'payment_date' => $this->resource['payment_date'] ?? null,
'status' => $this->resource['status'] ?? null,
'semester' => $this->resource['semester'] ?? null,
'school_year' => $this->resource['school_year'] ?? null,
'created_at' => $this->resource['created_at'] ?? null,
'updated_at' => $this->resource['updated_at'] ?? null,
];
}
}