PHP code example of fibtegis / filament-infinite-scroll

1. Go to this page and download the library: Download fibtegis/filament-infinite-scroll library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fibtegis / filament-infinite-scroll example snippets


    // app/Filament/Resources/CustomerResource/Pages/ListCustomers.php

    use Fibtegis\FilamentInfiniteScroll\Concerns\InteractsWithInfiniteScroll;
    use Filament\Resources\Pages\ListRecords;

    class ListCustomers extends ListRecords
    {
        use InteractsWithInfiniteScroll;

        // ...
    }
    

    // app/Filament/Resources/CustomerResource.php

    use Filament\Tables\Table;

    public static function table(Table $table): Table
    {
        return $table
            ->columns([
                // ... your columns ...
            ])
            ->filters([
                // ... your filters ...
            ])
            ->actions([
                // ... your actions ...
            ])
            ->bulkActions([
                // ... your bulk actions ...
            ])
            ->infinite(); // 👈 Just add this line
    }
    

->infinite(perPage: 50) // Load 50 records at a time (default: 25)
bash
php artisan optimize:clear