Also note this part
$view = 'dog/indexg';
$layout = ViewLayout::getLayout('dog/indexget');
$content = View::make($view)
->with('dogs', $dogs)
->with('pagelinks', $pagelinks);
return view($layout)->with('content', $content)->with('title', $title);
Is custom, as I don't use blade, so ignore this part and just return the view normally for blade.
But this part is needed if paginating
->with('pagelinks', $pagelinks)
And in view
<?php echo $pagelinks; ?> /// But convert to blade as needed
Edit: Adding custom pager example.
I mentioned a custom pager, here is an example
custompager.blade.php
@if ($paginator->hasPages())
<ul class="pagination pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="disabled"><span>«</span></li>
@else
<li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
@endif
@if($paginator->currentPage() > 3)
<li class="hidden-xs"><a href="{{ $paginator->url(1) }}">1</a></li>
@endif
@if($paginator->currentPage() > 4)
<li><span>...</span></li>
@endif
@foreach(range(1, $paginator->lastPage()) as $i)
@if($i >= $paginator->currentPage() - 2 && $i <= $paginator->currentPage() + 2)
@if ($i == $paginator->currentPage())
<li class="active"><span>{{ $i }}</span></li>
@else
<li><a href="{{ $paginator->url($i) }}">{{ $i }}</a></li>
@endif
@endif
@endforeach
@if($paginator->currentPage() < $paginator->lastPage() - 3)
<li><span>...</span></li>
@endif
@if($paginator->currentPage() < $paginator->lastPage() - 2)
<li class="hidden-xs"><a href="{{ $paginator->url($paginator->lastPage()) }}">{{ $paginator->lastPage() }}</a></li>
@endif
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<li><a href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
@else
<li class="disabled"><span>»</span></li>
@endif
</ul>
@endif
In this pager I am just decreasing the number of links, it just works better for mobile with fewer links. But you can write your own custom pager as required for your app.
For more on a custom pager, please refer to the docs, as Taylor covers it there.
