@if ($paginator->lastPage() > 1)
<{{ $wrapperTag }} class="{{ $wrapperClass }}">
<{{ $groupTag }} class="{{ $groupClass }}">
<{{ $itemTag }} class="{{ $itemClass }} {{ ($paginator->currentPage() == 1) ? ' ' . $disabledClass : '' }} go-first">
{!! $goFirstTitle !!}
{{ $itemTag }}>
<{{ $itemTag }} class="{{ $itemClass }} {{ (!$paginator->previousPageUrl()) ? ' ' . $disabledClass : '' }} previous">
{!! $goPrevTitle !!}
{{ $itemTag }}>
@for ($i = 1; $i <= $paginator->lastPage(); $i++)
@php
$half_total_links = floor($limit / 2);
$from = $paginator->currentPage() - $half_total_links;
$to = $paginator->currentPage() + $half_total_links;
if ($paginator->currentPage() < $half_total_links) {
$to += $half_total_links - $paginator->currentPage();
}
if ($paginator->lastPage() - $paginator->currentPage() < $half_total_links) {
$from -= $half_total_links - ($paginator->lastPage() - $paginator->currentPage()) - 1;
}
@endphp
@if ($from < $i && $i < $to)
<{{ $itemTag }} class="{{ $itemClass }} {{ ($paginator->currentPage() == $i) ? ' ' . $activatedClass : '' }}">
{{ $i }}
{{ $itemTag }}>
@endif
@endfor
<{{ $itemTag }} class="{{ $itemClass }} {{ (!$paginator->nextPageUrl()) ? ' ' . $disabledClass : '' }} next">
{!! $goNextTitle !!}
{{ $itemTag }}>
<{{ $itemTag }} class="{{ $itemClass }} {{ ($paginator->currentPage() == $paginator->lastPage()) ? ' ' . $disabledClass : '' }} go-last">
{!! $goLastTitle !!}
{{ $itemTag }}>
{{ $groupTag }}>
{{ $wrapperTag }}>
@endif