@php $elements = array_values($elements); $cnt = count($elements); if ($cnt == 5) { if (count($elements[0]) == 2) { array_pop($elements[0]); } if (count($elements[4]) == 2) { $key = key($elements[4]); unset($elements[4][$key]); } if (key($elements[0]) + 1 == key($elements[2])) { array_splice($elements, 1, 1); } else { end($elements[2]); if (key($elements[2]) + 1 == key($elements[4])) { array_splice($elements, 3, 1); } } } else if ($cnt == 3) { $cnt = count($elements[0]); if ($cnt > 4) { for ($i = 0; $i < $cnt - 4; $i++) { array_pop($elements[0]); } } $cnt = count($elements[2]); if ($cnt > 4) { for ($i = 0; $i < $cnt - 4; $i++) { $key = key($elements[2]); unset($elements[2][$key]); } } } @endphp @if ($paginator->hasPages())
@endif