F
Filamentβ€’12mo ago
_Lietze

How to find the current query of the list page?

I have this page where i get 2236 results by default, but when i tinker with Model::count() i get 150 more results than my resource list.. to debug this i would like to see the query built to show the results, so i can figure out what i did wrong
4 Replies
_Lietze
_LietzeOPβ€’12mo ago
For people wondering, I found a solution the non-filament way: Added to boot() in AppServiceProvider.php:
\Event::listen('Illuminate\Database\Events\QueryExecuted', function ($query) {
logger([$query->sql, $query->bindings, $query->time]);
});
\Event::listen('Illuminate\Database\Events\QueryExecuted', function ($query) {
logger([$query->sql, $query->bindings, $query->time]);
});
You can find all queries per page logged in the laravel log files
DariusIII
DariusIIIβ€’12mo ago
You could add getTableQuery override on list page and dump the original query results or its raw query.
_Lietze
_LietzeOPβ€’12mo ago
oh that's great! Will remember that one for next time πŸ˜„ TY!
DrByte
DrByteβ€’11mo ago
Laravel DebugBar will also show you the queries.
Want results from more Discord servers?
Add your server