add controllers, servoices
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Payments;
|
||||
|
||||
use App\Models\Payment;
|
||||
|
||||
class PaymentLookupService
|
||||
{
|
||||
public function getByParent(int $parentId, ?string $schoolYear = null): array
|
||||
{
|
||||
$query = Payment::query()->where('parent_id', $parentId);
|
||||
|
||||
if ($schoolYear) {
|
||||
$query->where('school_year', $schoolYear);
|
||||
}
|
||||
|
||||
return $query->orderByDesc('payment_date')->get()->toArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user