add controllers, servoices
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Reimbursements;
|
||||
|
||||
use App\Models\Reimbursement;
|
||||
|
||||
class ReimbursementLookupService
|
||||
{
|
||||
public function findReimbursementIdForExpense(int $expenseId): ?int
|
||||
{
|
||||
if ($expenseId <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$row = Reimbursement::query()
|
||||
->select('id')
|
||||
->where('expense_id', $expenseId)
|
||||
->orderByDesc('id')
|
||||
->first();
|
||||
|
||||
return $row ? (int) $row->id : null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user