Skip to content

Instantly share code, notes, and snippets.

@Tom-Millard
Last active August 29, 2015 14:19
Show Gist options
  • Save Tom-Millard/55c8fb214e8aaed9b31d to your computer and use it in GitHub Desktop.
Save Tom-Millard/55c8fb214e8aaed9b31d to your computer and use it in GitHub Desktop.
Custom Laravel Pagination View with Font Awesome
@if ($paginator->getLastPage() > 1)
<ul class="pagination">
<li>
<a href="{{ $paginator->getUrl(1) }}" class="pagination__item-{{ ($paginator->getCurrentPage() == 1) ? ' pagination__disabled' : '' }} btn pagination__option"><i class="fa fa-arrow-circle-left"></i> Previous</a>
</li>
@for ($i = 1; $i <= $paginator->getLastPage(); $i++)
<li>
<a href="{{ $paginator->getUrl($i) }}" class="pagination__item-{{ ($paginator->getCurrentPage() == $i) ? ' pagination__active' : '' }} btn pagination__option">{{ $i }}</a>
</li>
@endfor
<li>
<a href="{{ $paginator->getUrl($paginator->getCurrentPage()+1) }}" class="pagination__item-{{ ($paginator->getCurrentPage() == $paginator->getLastPage()) ? ' pagination__disabled' : '' }} btn pagination__option"> Next <i class="fa fa-arrow-circle-right"></i></a>
</li>
</ul>
@endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment