2

According to Laravel Documentation

In other frameworks, pagination can be very painful. Laravel makes it a breeze. Laravel can quickly generate an intelligent "range" of links based on the current page, and the generated HTML is compatible with the Bootstrap CSS framework.

My question is Foundation also compatible with Laravel's pagination?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Jonh Doe
  • 761
  • 1
  • 9
  • 25

2 Answers2

1

There is nothing to stop Laravel pagination working with Foundation but the default HTML generated by Laravel is Bootstrap specific. There is no mention in the docs or API to suggest that it can generate Foundation-specific code.

You have two choices. One is to write your own custom code (covered elsewhere on Stack Overflow, although not specifically for Foundation)

The other option is to pull in a specific package that someone else has written:

Laravel 4

https://github.com/binarix/Laravel-Foundation-Pagination

Laravel 5

https://github.com/etcinit/foundation-pagination

Community
  • 1
  • 1
Joseph
  • 2,737
  • 1
  • 30
  • 56
0

You can easily pass the paginator data to your own view of a paginator. - Meaning you can do the following:

Create a folder named components in your views folder and then create a pagination view; after pass the pagination data to the component created and include it as shown below in any of your views.

Getting a paginated data set:

$yourPaginationData = App\YourModel::orderBy('id', 'desc')->with(['relation'])->paginate(15)

Including the pagination:

@include('components.pagination', ['paginator' => $yourPaginationData])

In the view, one can manipulate the pagination data as needed and create their own design and idea of pagination.

You can also find something open-source for foundation that was custom built to work with laravel here.

Julian Camilleri
  • 2,975
  • 1
  • 25
  • 34