Download the PHP package asignua/filament-infinite-scroll without Composer

On this page you can find all versions of the php package asignua/filament-infinite-scroll. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-infinite-scroll

Filament Infinite Scroll

Stand With Ukraine Latest Version on Packagist Tests Total Downloads License Plumb score

Filament Infinite Scroll

Infinite scroll and a "Load more" button for Filament tables, with one line:

Filament 5 offers default, simple and cursor pagination only. People keep asking for a table that just grows (#12764, #5692), and the one existing plugin supports Filament 3 only. This one is built for Filament 5.

Screenshots

Scroll mode loading the next chunk

Everything loaded

Requirements

Installation

The service provider is auto-discovered. filament:assets publishes a 1 KB stylesheet that hides Filament's own pager on these tables and lays out the footer. Optionally publish the config:

Usage

infiniteScroll() is a macro on Filament\Tables\Table. Call it in any table(): a resource, a relation manager, a table widget, a page with InteractsWithTable.

Every argument is optional and defaults to config/filament-infinite-scroll.php.

Mode Behaviour
scroll The next chunk loads when the end of the table scrolls into view. If the new rows do not push the end out of view (a tall screen) the next chunk follows at once.
button A "Load more" button under the table.

Under the rows the table shows "Showing 25 of 120", then "All 120 records are loaded" when the list is complete. A table with fewer rows than one chunk shows no footer at all, and no stock pager either. Counts are formatted for the current app locale.

How it works

Filament's table is one query and one Blade view. The plugin forks neither.

  1. The page size grows. The table's $tableRecordsPerPage (a public Livewire property) goes 25 → 50 → 75 …, the page stays 1. Because it is still a single paginated query, selection, "select all", bulk actions, grouping, summaries and record actions work exactly as on a normal page.
  2. A global Livewire hook answers the infiniteScrollLoadMore call, so no trait or base class has to be added to your pages, relation managers or widgets. The same hook keeps the page size inside [one chunk, ceiling] and pins the page number to 1. The value is client-writable, so the server also remembers the size it issued last (in the checksummed memo) and never lets the browser raise it: the list grows only one chunk per call, with or without a ceiling.
  3. A render hook (TablesRenderHook::CONTENT_AFTER) draws the footer: the status line, the x-intersect sentinel or the button (<x-filament::button>).
  4. Reset on change. A signature of the search, column searches, filters, sort, grouping, the active tab and a widget's dashboard pageFilters is kept in the Livewire memo (checksummed with the snapshot). When it changes the list starts over from the first chunk.

Scroll position is preserved: Livewire morphs the new rows in below the existing ones.

Trade-offs

Configuration

config/filament-infinite-scroll.php:

Key Default
per_page 25 Rows per chunk.
mode 'scroll' 'scroll' or 'button'.
max_records 500 The most rows kept on the page; null removes the ceiling.
root_margin 300 Pixels before the end at which the next chunk is requested.

When the ceiling is reached the footer says "Showing the first 500 of 12,345 records. Use search or filters to narrow the list." and loading stops.

Gotchas

Translations

English, Ukrainian, German, Spanish, French, Italian, Dutch, Polish, Brazilian Portuguese and Turkish, under the filament-infinite-scroll::infinite-scroll namespace. A test keeps every language in step with the English keys and placeholders.

AI agents

The package ships Laravel Boost guidelines (resources/boost/guidelines/core.blade.php) so a coding agent uses the macro correctly.

Testing

The suite runs on Orchestra Testbench with a workbench/ panel: a resource, a relation manager and a table widget.

The suite checks what the server renders (data-has-more, data-loaded, the footer's wire:key), not the Alpine code that reads it. Before a release, check scroll mode by hand in a browser:

  1. A tall viewport with many records: the list fills the screen on its own and stops once the footer is out of view.
  2. Scroll to the ceiling: loading stops and the "Showing the first N" notice appears; no further requests in the network tab.
  3. With the footer still in view (all or the ceiling loaded), sort or filter: the list starts over and, on a short page, loads the next chunk again without scrolling.
  4. Make a load request fail (go offline): the footer does not retry in a loop.

Changelog

See CHANGELOG.md.

More plugins by asign

All plugins: https://filamentphp.com/plugins?q=asign

License

The MIT License (MIT). See LICENSE.md.


All versions of filament-infinite-scroll with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
filament/filament Version ^5.11.2
illuminate/contracts Version ^12.0|^13.0
livewire/livewire Version ^4.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package asignua/filament-infinite-scroll contains the following files

Loading the files please wait ...