hgms
hgms
FFilament
Created by hgms on 5/31/2024 in #❓┊help
Help understanding/troubleshooting slow queries
I'm using Filament v2 and have a table I've been trying to diagnose an issue with, which is slowness when querying the database that only occurs when using the Filament Resource/Table component with default individual column search. When I use the individual search column and supply two space-separated terms, the query is very slow. However, if I customize the search for that column and create the query manually, or if I run the slow query directly from \DB::select, the performance is great. I'm trying to figure out what would cause the slowness for this one set of conditions and I can't seem to figure it out. Any thoughts?
// Customized column search
->searchable(query: function (Builder $query, string $search): Builder {
return $query->where('_raw', 'like', "%$search%");
}, isIndividual: true)
// Customized column search
->searchable(query: function (Builder $query, string $search): Builder {
return $query->where('_raw', 'like', "%$search%");
}, isIndividual: true)
Query stats for the default search, default search ran from tinker/DB::select, and the customized column search.
[2024-05-31 12:37:02] local.INFO: query_log {"query":"select top 11 * from [syslogs] where ([_raw] like '%filter1%') and ([_raw] like '%filter2%') order by [id] desc","time":67506.94} -> default search
[2024-05-31 12:38:16] local.INFO: query_log {"query":"select top 11 * from [syslogs] where ([_raw] like '%filter1%') and ([_raw] like '%filter2%') order by [id] desc","time":75.9} -> from tinker
[2024-05-31 12:34:57] local.INFO: query_log {"query":"select top 11 * from [syslogs] where (([_raw] like '%filter1%')) and (([_raw] like '%filter2%')) order by [id] desc","time":67.97} -> custom search
[2024-05-31 12:37:02] local.INFO: query_log {"query":"select top 11 * from [syslogs] where ([_raw] like '%filter1%') and ([_raw] like '%filter2%') order by [id] desc","time":67506.94} -> default search
[2024-05-31 12:38:16] local.INFO: query_log {"query":"select top 11 * from [syslogs] where ([_raw] like '%filter1%') and ([_raw] like '%filter2%') order by [id] desc","time":75.9} -> from tinker
[2024-05-31 12:34:57] local.INFO: query_log {"query":"select top 11 * from [syslogs] where (([_raw] like '%filter1%')) and (([_raw] like '%filter2%')) order by [id] desc","time":67.97} -> custom search
4 replies
FFilament
Created by hgms on 10/4/2023 in #❓┊help
Preventing "No records found" state
I have a table with 12 columns that are each individually searchable. When the user keys in a search that returns no records, the UI flips to display the "No records found" state, which removes all of the column filters and requires the user to click on the "Clear column search" action. I would prefer to keep the table display standard and return no rows while maintaining the column headers if possible. Is that something that can be controlled with a Filament option, or would it require a custom extension of the existing table logic?
6 replies
FFilament
Created by hgms on 7/25/2023 in #❓┊help
Importing Filament Custom Pages
I'm building out a custom dashboard and have not been able to include one Filament custom page inside another (using @livewire() or <livewire /> ). It says "unable to find component". Is this expected? I can import other Filament components under the App\Filament namespace, but nothing that lives in Pages. Thanks.
10 replies
FFilament
Created by hgms on 6/15/2023 in #❓┊help
Help with getTableRecordClassesUsing
22 replies
FFilament
Created by hgms on 6/7/2023 in #❓┊help
ViewAction on custom page
I created a custom page that's using the Table builder package with a ViewAction. When I click on view in the table, it pops open the modal but there's no content. I have the form schema defined but I can't for the life of me figure out how to connect the form with the ViewAction modal. Is this doable? Thanks.
10 replies