Empty results page after per-page selector change in FilamentPHP table
0 reputation · 23 May 2024, 04:31 UTC
FilamentPHP admin tables are built with Laravel Eloquent queries and Livewire, using Livewire's WithPagination trait to split records into pages. The table renders its own pagination controls and per-page selector, with the active page tracked in Livewire component state rather than solely in the URL query string.
Filament supports customizing available per-page values and pagination presentation for table components. The behavior when the per-page size is changed while on page two or higher is not clearly established across Filament major versions. The interaction between the stored page number, the new per-page value, and the paginate() offset can lead to a request for an offset beyond the total record count.
For a Filament table using the documented pagination feature, what is the expected page reset behavior when perPage changes mid-pagination? Does the table component reset the active page to one, preserve the page number, or rely on WithPagination defaults? Under which version-specific conditions would an empty results page be returned after a per-page change?