Problems in duplicate query detected at debugbar
Here's a table action I'm using, with some conditions to be visible
Action::make('verifikasi')
->icon('heroicon-o-magnifying-glass')
->visible(function ($record) {
if (
$record->trans_ref != null
&& in_array($record->status_konf, ['Baru', 'Pending', 'Cek Lagi'])
) {
return Setoran::unconfirm()
->where('rekening_id', $record->rekening_id)
->whereDate('tanggal', '>=', date('Y-m-d', strtotime($record->tanggal)))
->where('dana', $record->dana)
->exists();
}
})
The problem is, why the query of model Setoran above is detected duplicate or executed twice in debugbar queries tab?
The conditions above is only met in one record at the table.
I hope someone can explain me what's wrong.
0 Replies