Skip to content

Instantly share code, notes, and snippets.

@ankur13secret
Created January 5, 2016 06:25
Show Gist options
  • Save ankur13secret/314e1faaf916bd46782e to your computer and use it in GitHub Desktop.
Save ankur13secret/314e1faaf916bd46782e to your computer and use it in GitHub Desktop.
Laravel Custom Pagination View
//Try Using
@include('pagination.default', ['paginator' => $value])
//Use this way in your file to view
@if ($paginator->lastPage() > 1)
<ul class="pagination">
<li class="{{ ($paginator->currentPage() == 1) ? ' disabled' : '' }}">
<a href="{{ $paginator->url(1) }}">Previous</a>
</li>
@for ($i = 1; $i <= $paginator->lastPage(); $i++)
<li class="{{ ($paginator->currentPage() == $i) ? ' active' : '' }}">
<a href="{{ $paginator->url($i) }}">{{ $i }}</a>
</li>
@endfor
<li class="{{ ($paginator->currentPage() == $paginator->lastPage()) ? ' disabled' : '' }}">
<a href="{{ $paginator->url($paginator->currentPage()+1) }}" >Next</a>
</li>
</ul>
@endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment