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,23 @@
<?php
namespace App\Services\ExtraCharges;
use App\Models\AdditionalCharge;
class ExtraChargesListService
{
public function listForTerm(string $schoolYear, string $semester, ?string $status, ?string $q, int $perPage): array
{
$rows = AdditionalCharge::listAllForTerm($schoolYear, $semester, $status, $q, $perPage);
$meta = [
'perPage' => method_exists($rows, 'perPage') ? $rows->perPage() : $perPage,
'page' => method_exists($rows, 'currentPage') ? $rows->currentPage() : null,
'total' => method_exists($rows, 'total') ? $rows->total() : null,
'pageCount' => method_exists($rows, 'lastPage') ? $rows->lastPage() : null,
];
$items = method_exists($rows, 'items') ? $rows->items() : (array) $rows;
return [$items, $meta];
}
}