Closed adamkelso closed 2 years ago
filament/tables
v22.9.16
v8.81.0
v2.10.1
8.1
First off, thank you for working on Filament. This project is awesome!
Following the documentation, it appears tables do not allow soft deleted query builders to use withTrashed or onlyTrashed macros.
withTrashed
onlyTrashed
The following is a the code used for my table filters array
->filters([ Tables\Filters\Filter::make('deleted') ->label('Deleted') ->query(fn ($query) => $query->onlyTrashed()), Tables\Filters\Filter::make('used') ->query(fn ($query) => $query->whereHas('orders')) ->label('Used'), Tables\Filters\SelectFilter::make('type') ->options([ 'flat' => 'Flat', 'percent' => 'Percent' ]) ]);
The second and third filters work without issue. However, no records show when the "deleted" filter is selected, though there are more than 30 soft deleted record in the table. Any ideas what I might be doing wrong?
No response
https://filamentadmin.com/docs/2.x/admin/resources#disabling-global-scopes
Missed that in the docs. Thanks for pointing that out.
Package
filament/tables
Package Version
v22.9.16
Laravel Version
v8.81.0
Livewire Version
v2.10.1
PHP Version
8.1
Bug description
First off, thank you for working on Filament. This project is awesome!
Following the documentation, it appears tables do not allow soft deleted query builders to use
withTrashed
oronlyTrashed
macros.The following is a the code used for my table filters array
The second and third filters work without issue. However, no records show when the "deleted" filter is selected, though there are more than 30 soft deleted record in the table. Any ideas what I might be doing wrong?
Steps to reproduce
No response
Relevant log output
No response