When I use limit(1) in the contain section it does not work properly.
‘Expenses’ => function ($q){
return $q->where([
‘Expenses.is_paid’=>0,
‘Expenses.amount >’=>0,
])
->select([
‘Expenses.id’,
‘Expenses.payment_date’,
‘Expenses.amount’,
‘Expenses.is_paid’,
])
->order([‘Expenses.payment_date’=> ‘ASC’])
->limit([5]);