© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•15mo ago•
7 replies
Prodex

Overriding paginateTableQuery doesn't work on Widgets

The TableWidet Class has a paginateTableQuery method where simplePagination is used. The docs say, this can be overwritten. But using the method in my Widget doesn't work. It still shows the simplePagination.

With dd() I can verify that the method gets called though. Any ideas?

Code:

use Filament\Widgets\TableWidget;
use Illuminate\Contracts\Pagination\CursorPaginator;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

class CompanyProximitySearch extends TableWidget
{
    public ?Model $record = null;

    protected int|string|array $columnSpan = 'full';

    protected function paginateTableQuery(Builder $query): CursorPaginator
    {
        return $query->cursorPaginate(($this->getTableRecordsPerPage() === 'all') ? $query->count() : $this->getTableRecordsPerPage());
    }
}
use Filament\Widgets\TableWidget;
use Illuminate\Contracts\Pagination\CursorPaginator;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

class CompanyProximitySearch extends TableWidget
{
    public ?Model $record = null;

    protected int|string|array $columnSpan = 'full';

    protected function paginateTableQuery(Builder $query): CursorPaginator
    {
        return $query->cursorPaginate(($this->getTableRecordsPerPage() === 'all') ? $query->count() : $this->getTableRecordsPerPage());
    }
}
Solution
Yes I see, but in that case the paginateTableQuery is set to simple when extending the TableWidget. Changing it to extend "Widget" solves the issue. But I still don't know why the overwrite didn't work, as it normally should.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Tenant middleware doesn't apply on widgets
FilamentFFilament / ❓┊help
8mo ago
Overriding classes of blade components in widgets
FilamentFFilament / ❓┊help
3y ago
afterStateUpdated doesn't work
FilamentFFilament / ❓┊help
2y ago
ExportBulkAction doesn't work
FilamentFFilament / ❓┊help
2y ago