Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builder backwards incompatible #16528

Closed
piotrtheis opened this issue Nov 23, 2016 · 3 comments
Closed

Builder backwards incompatible #16528

piotrtheis opened this issue Nov 23, 2016 · 3 comments

Comments

@piotrtheis
Copy link

  • Laravel Version: #.#.#
  • PHP Version: 7.0.8
  • Database Driver & Version:

Description:

@taylorotwell LengthAwarePaginator should use custom model collection from newCollection not Collection, even if query result is empty.

from docs

from
to

Steps To Reproduce:

$results = $this->forPage($page, $perPage)->get($columns);

instead of

$results = $total ? $this->forPage($page, $perPage)->get($columns) : new Collection;

in

@vlakoff
Copy link
Contributor

vlakoff commented Nov 23, 2016

Makes sense to transmit the same class, whether results are empty or not.

If you want to keep the optimization from #14188:

$results = $total
    ? $this->forPage($page, $perPage)->get($columns)
    : $this->model->newCollection();

@GrahamCampbell
Copy link
Member

We're open to PRs. :)

@vlakoff
Copy link
Contributor

vlakoff commented Nov 25, 2016

Submitted #16547.

Though may I suggest to close issues after a PR has been opened? If an issue is worth fixing but is closed, it's easy to forget about it…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants