Change default table query to get only the soft deleted records
Hello all,
For a project im working on I need my table results to only show the soft deleted records.
I want it so that instead of currently returning the default parent::getTableQuery instead a where or something like that that makes it so it only gets soft deleted records.
7 Replies
can you try to add the where with "deleted_at" column NOT NULL or use the onlyTrashed() method on the model
Use the trashed filter and apply trashed by default
Ty for the replies I used the onlyTrashed method on the model like this:
Plese read the docs? You can use the native filament trashed features then on the filter just set ->default is the trashed method
I did read the docs and i already had tried the exact same thing earlier. The problem was that I had a default trashed filter where trashed was hidden.
But if you apply the default trashed filter then within the filter options it’ll be applied by default
Yeah I know that but, I have some logic in the getTableQuery() where it sometimes needs to show the trashed and sometimes it doesn't