filamentphp / 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.
https://filamentphp.com
MIT License
18.39k stars 2.87k forks source link

Cursor pagination doesn't work #11602

Closed Sh1d0w closed 7 months ago

Sh1d0w commented 7 months ago

Package

filament/filament

Package Version

v3.0.0

Laravel Version

v10.0.0

Livewire Version

v3.0.0

PHP Version

PHP 8.3.0

Problem description

According to the documentation here https://filamentphp.com/docs/3.x/tables/advanced , we can implement cursor pagination, however trying the example does not work, because we are returning use Illuminate\Contracts\Pagination\CursorPaginator, however the class declaration expects use Illuminate\Contracts\Pagination\Paginator;

Expected behavior

Cursor pagination should work and PHP should not throw error

Steps to reproduce

Follow the docs to add cursor pagination to a listing

Reproduction repository

https://github.com/filamentphp/filament

Relevant log output

Declaration of App\Filament\Resources\ProductResource\Pages\ListProducts::paginateTableQuery(Illuminate\Database\Eloquent\Builder $query): Illuminate\Contracts\Pagination\CursorPaginator must be compatible with Filament\Resources\Pages\ListRecords::paginateTableQuery(Illuminate\Database\Eloquent\Builder $query): Illuminate\Contracts\Pagination\Paginator
github-actions[bot] commented 7 months ago

Hey @Sh1d0w! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.