Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

The Paginator interface does not implement through method #51165

Copy link
Copy link
Closed
@Bloemendaal

Description

@Bloemendaal
Issue body actions

Laravel Version

10.48.8

PHP Version

8.3.4

Database Driver & Version

mysql Ver 8.3.0 for macos14.2 on arm64 (Homebrew)

Description

The paginate() method of the Illuminate\Database\Eloquent\Builder returns the interface LengthAwarePaginator, which implements the Paginator interface (also on master):
https://github.com/laravel/framework/blob/master/src/Illuminate/Contracts/Pagination/Paginator.php#L5

This interface does not implement the through() method, even though this is a part of AbstractPaginator. This causes my IDE to place red lines:

$pokemon = Pokemon::query()
      ->paginate(30)
      ->through(static fn (Pokemon $pokemon): PokemonData => PokemonData::fromModel($pokemon));

image

Undefined method 'through'.

Can we add this method to the Paginator interface to prevent these errors?

Steps To Reproduce

Paginate any model and call the through() method. It should work fine, but the IDE will give an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.