Filament Table tab
I'm trying to apply a condition on the Filament table tab so that when is_archived = 1, it should display in the 'Archived' tab. However, it's not working in my case. I've attached the code for your reference.
19 Replies
I'm not sure why your query isn't working, but there is a Filament plugin that can handle all of this for you
Filament
Archivable by OKE Online - Filament
This plugin allows you to archive, unarchive, and filter archived records in your application.
Thank you for your prompt response but I want to use filter as a table tab. Hope anyone can give some solution.
the issue happens when you try to search something? I didn't understand the issue..
No, I am not searching anything, I am just clicking on the Archived tab. And for that below code executes (Just refer the 'archived' key):
you mean,
->where('is_archived', true)
isn't working?Yes, exactly
is it a boolean column? new, on_site work?
Yes
?activeTab=archived
in the url?Yes,
did you create a global scope to filter it globally?
No, not created
maybe you could provide a minimal repo on github to reproduce this issue
Okay, I will share the git repo with same issue
if
->where('is_archived', false)
works, true
was supposed to work as wellI have checked with false also but still it is not working
weird
Yeah, it's weird