F
Filament4mo ago
dyo

Problem with bulk selection in custom page table

I'm using filament table on a custom page. If I select bulk data, and I choose to select all, why is it only selected the first row? What am I missing?
3 Replies
Dennis Koch
Dennis Koch4mo ago
Is your model using a different primary key then id? Can you share a video/screenshot?
dyo
dyoOP4mo ago
Sorry for late response.. Here's the query of the table:
$selectColumns = [
'prospek.*',
'lembaga.nama_lembaga',
'prioritas.nama_prioritas',
DB::raw('(SELECT SUM(dana) FROM konfirmasi WHERE prospek_id = prospek.id) as jumlah_donasi'),
DB::raw('(SELECT dana FROM konfirmasi WHERE prospek_id = prospek.id ORDER BY id DESC LIMIT 1) as last_donation1'),
];

$donatur = Donatur::select($selectColumns)
->leftJoin('konfirmasi', 'prospek.id', 'prospek_id')
->leftJoin('lembaga', 'prospek.lembagaId', 'lembaga.id')
->leftJoin('prioritas', 'prospek.prioritas_id', 'prioritas.id')

return $table
->query($donatur)
$selectColumns = [
'prospek.*',
'lembaga.nama_lembaga',
'prioritas.nama_prioritas',
DB::raw('(SELECT SUM(dana) FROM konfirmasi WHERE prospek_id = prospek.id) as jumlah_donasi'),
DB::raw('(SELECT dana FROM konfirmasi WHERE prospek_id = prospek.id ORDER BY id DESC LIMIT 1) as last_donation1'),
];

$donatur = Donatur::select($selectColumns)
->leftJoin('konfirmasi', 'prospek.id', 'prospek_id')
->leftJoin('lembaga', 'prospek.lembagaId', 'lembaga.id')
->leftJoin('prioritas', 'prospek.prioritas_id', 'prioritas.id')

return $table
->query($donatur)
What should I do with this?
Dennis Koch
Dennis Koch4mo ago
Hm. Not sure if the query is the issue. I think as long as you have an ID you should be fine
Want results from more Discord servers?
Add your server