<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">

<style>
.paginationWrap{
    width: 100%;
    text-align: center;
}
.paginationWrap ul{
    width: 100%;
    position: relative;
} 
.paginationWrap ul li {
    display: inline-block;
    background-color: #FFF;
    color: #000;
    padding: 4px 8px 4px 8px; 
    border-radius: 3px
}
.paginationWrap ul li.active, .paginationWrap ul li:hover{
    background-color: red;
}


.paginationWrap ul li.disabled{
    background-color: #808080;
}
.paginationWrap ul li a{
    color: #000;
    text-decoration: none;
    font-weight: bold;
}
.paginationWrap ul li span{
    color: #FFF;
    font-weight: bold;
} 

</style>
@if ($paginator->hasPages())   
    <ul class="pagination">
        @if ($paginator->onFirstPage())
            <li class="disabled">
                <i class="fa-solid fa-angles-left"></i>
            </li>
            <li class="disabled">
                <i class="fa-solid fa-angle-left"></i>
            </li>                
        @else
            <li>
                <a href="{{ $paginator->url(1) }}&search={{ request('search') }}&timkiem=Tìm+kiếm&_token={{ csrf_token() }}">
                    <i class="fa-solid fa-angles-left"></i>
                </a>
            </li>
            <li>
                <a href="{{ $paginator->previousPageUrl() }}&search={{ request('search') }}&timkiem=Tìm+kiếm&_token={{ csrf_token() }}">
                    <i class="fa-solid fa-angle-left"></i>
                </a>
            </li>
        @endif

        @foreach ($elements as $element)
            @if (is_array($element))
                @foreach ($element as $page => $url)
                    @if ($page == $paginator->currentPage())
                        <li class="active"><span>{{ $page }}</span></li>
                    @elseif ($page <= 10 || $page == $paginator->currentPage() + 1 || $page == $paginator->currentPage() + 2 || $page == $paginator->lastPage())
                        <li><a href="{{ $url }}&search={{ request('search') }}&timkiem=Tìm+kiếm&_token={{ csrf_token() }}">{{ $page }}</a></li>
                    @elseif ($page == $paginator->lastPage() - 1)
                        <li class="disabled"><span><i class="fa fa-ellipsis-h"></i></span></li>
                    @endif
                @endforeach
            @endif
        @endforeach

        @if ($paginator->hasMorePages())
            <li>
                <a href="{{ $paginator->nextPageUrl() }}&search={{ request('search') }}&timkiem=Tìm+kiếm&_token={{ csrf_token() }}">
                    <i class="fa-solid fa-angle-right"></i>
                </a>
            </li>
            <li>
                <a href="{{ $paginator->url($paginator->lastPage()) }}&search={{ request('search') }}&timkiem=Tìm+kiếm&_token={{ csrf_token() }}">
                    <i class="fa-solid fa-angles-right"></i>
                </a>
            </li>
        @else
            <li class="disabled">
                <i class="fa-solid fa-angle-right"></i>
            </li>
            <li class="disabled">
                <i class="fa-solid fa-angles-right"></i>
            </li>
        @endif
    </ul>    
@endif

