Skip to content

[12.x] create a Pagination component #56295

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

Closed
wants to merge 5 commits into from

Conversation

browner12
Copy link
Contributor

This component generates the same output as ->links(), but provides the more familiar component pattern for declaring it. I believe this is better because:

  • it allows consistent usage of components throughout user's codebase
  • opens up the opportunity for the framework to easily provide more controlled customization of the output of the pagination. for example, you could pass an attribute to disable the "Showing X to X of X results".

Previously:

{{ $blogs->links() }}

New:

<x-laravel::pagination :paginator="$blogs"></x-laravel::pagination>

Users still have the ability to pass their own custom view and data to the component:

<x-laravel::pagination
    :paginator="$blogs"
    view="/my/custom/view"
    :data="['foo', 'bar', 'baz']"
></x-laravel::pagination>

I have not added any additional customization in this PR, but opted to wait to see if this would be accepted.

this component generates the same output as `->links()`, but provides the more familiar component pattern for declaring it.
the "prefix" parameter didn't do what I thought it did
this allows the user to continue using the *logic* of the Paginator and Component, but fully customize the styling with their own view.
@browner12
Copy link
Contributor Author

could someone re-trigger tests for me? I think there was a pipeline issue when I created this.

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

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

Successfully merging this pull request may close these issues.

2 participants