F
Filament12mo ago
nät

My table data disappears when I put a custom filter

No description
No description
No description
8 Replies
Tieme
Tieme12mo ago
$data['id']
nät
nätOP12mo ago
returns this error
No description
toeknee
toeknee12mo ago
->where('id', (int) $data['id'])
->where('id', (int) $data['id'])
nät
nätOP12mo ago
i've tried but still no data, like when the filter is selected there's info but when its blank returns nothing
toeknee
toeknee12mo ago
I think I know why, do a dd($data) above the return
nät
nätOP12mo ago
oh no
No description
nät
nätOP12mo ago
only appears when a filter is selected
No description
toeknee
toeknee12mo ago
Correct and that's how a filter form is supported to work. So you need to do:
return $data['id'] ? $query->where('id', $data['id']) : $query;
return $data['id'] ? $query->where('id', $data['id']) : $query;
Want results from more Discord servers?
Add your server