Fast Pagination

@Dan Harrin I implemented the trick for fast pagination you outlined (https://filamentphp.com/community/danharrin-fast-table-pagination) but there is one issue. When selecting All records, it returns an error for trying to multiply string * int.

I changed the function to:

protected function paginateTableQuery(Builder $query): Paginator
    {
        return $query->fastPaginate(($this->getTableRecordsPerPage() == 'all') ? 9999 : $this->getTableRecordsPerPage());
    }


and that avoids the error. I'm not sure if there is a better way around this.

I didn't see a way to comment on the community post so I'm doing it here. Just wanted you to know. Filament is amazing - thank you!
Filament
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
Was this page helpful?