@if ($paginator->hasPages())
    <ul class="pg-pagination list-unstyled">
        {{-- Previous Page Link --}}
        @if ($paginator->onFirstPage())
            <li class="prev disabled"><a href="#"><i class="fas fa-arrow-left"></i></a></li>
        @else
            <li class="prev"><a href="{{ $paginator->previousPageUrl() }}"><i class="fas fa-arrow-left"></i></a></li>
        @endif

        {{-- Pagination Elements --}}
        @foreach ($elements as $element)
            @if (is_string($element))
                <li class="count disabled"><a href="#">{{ $element }}</a></li>
            @endif
            @if (is_array($element))
                @foreach ($element as $page => $url)
                    @if ($page == $paginator->currentPage())
                        <li class="count active"><a href="#">{{ $page }}</a></li>
                    @else
                        <li class="count"><a href="{{ $url }}">{{ $page }}</a></li>
                    @endif
                @endforeach
            @endif
        @endforeach

        {{-- Next Page Link --}}
        @if ($paginator->hasMorePages())
            <li class="next"><a href="{{ $paginator->nextPageUrl() }}"><i class="fas fa-arrow-right"></i></a></li>
        @else
            <li class="next disabled"><a href="#"><i class="fas fa-arrow-right"></i></a></li>
        @endif
    </ul>
@endif