HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/farmfun.komma.pro/resources/views/site/components/pagination7.blade.php
 <ul class="c-pagination">

    {{--Previous Page--}}
    <li class="c-pagination__item @if(!$paginator->previousPageUrl()) is-disabled @endif">
        @if($paginator->previousPageUrl())
            <a class="c-pagination__prev" href="{{ $paginator->previousPageUrl() }}" rel="prev">
                <svg width="7" height="10">
                    <use href="/img/icon-arrowLeft.svg#arrowLeft"></use>
                </svg>
            </a>
        @else
            <span class="c-pagination__prev">
                <svg width="7" height="10">
                    <use href="/img/icon-arrowLeft.svg#arrowLeft"></use>
                </svg>
            </span>
        @endif
        @include('site.components.pagination.cowSpot')
    </li>

    {{--First Page--}}
    <li class="c-pagination__item  @if($paginator->currentPage() == 1) is-active @endif">
        @if($paginator->currentPage() != 1)
            <a class="c-pagination__link" href="{{ $paginator->url(1) }}">1</a>
        @else
            <span class="c-pagination__link">1</span>
        @endif
        @include('site.components.pagination.cowSpot')
    </li>


    {{-- Now the hard part, the middle --}}

    {{-- All pages can be shown, because there are less then 7 so no dots --}}
    @if($paginator->lastPage() <=  7)

        @for($paginationPage = 2; $paginationPage < $paginator->lastPage() ; $paginationPage++)

            @include('site.components.pagination.item')

        @endfor

    {{-- Dotted pagination needed --}}
    @else

        {{-- Current page is below 4, so first 6 items can be shown --}}
        @if($paginator->currentPage() <= 4)

            @for($paginationPage = 2; $paginationPage <= 6 ; $paginationPage++)

                @include('site.components.pagination.item')

            @endfor

            {{-- Dots are needed in the end --}}
            @include('site.components.pagination.dots')


            {{-- Current page is one of the last 4, so the last 6 items can be shown --}}
        @elseif($paginator->currentPage() >= ($paginator->lastPage() - 3) )

            {{-- Dots are needed at the start --}}
            @include('site.components.pagination.dots')

            @for($paginationPage = ($paginator->lastPage() - 5); $paginationPage < $paginator->lastPage(); $paginationPage++)

                @include('site.components.pagination.item')

            @endfor

            {{-- Dots before and after --}}
        @else
            @include('site.components.pagination.dots')

            @for($paginationPage = ($paginator->currentPage() - 2); $paginationPage <= ($paginator->currentPage() + 2); $paginationPage++)

                @include('site.components.pagination.item')

            @endfor

            @include('site.components.pagination.dots')

        @endif

    @endif


    {{--Last page--}}
    <li class="c-pagination__item  @if($paginator->currentPage() === $paginator->lastPage()) is-active @endif">
        @if($paginator->currentPage() !== $paginator->lastPage())
            <a class="c-pagination__link" href="{{ $paginator->url($paginator->lastPage()) }}">{{$paginator->lastPage()}}</a>
        @else
            <span class="c-pagination__link">{{$paginator->lastPage()}}</span>
        @endif
        @include('site.components.pagination.cowSpot')
    </li>

    {{--Next Page--}}
    <li class="c-pagination__item  @if(!$paginator->nextPageUrl())  is-disabled  @endif">
        @if($paginator->nextPageUrl())
            <a class="c-pagination__next" href="{{ $paginator->nextPageUrl() }}" rel="next">
                <svg width="7" height="10">
                    <use href="/img/icon-arrowRight.svg#arrowRight"></use>
                </svg>
            </a>
        @else
            <span class="c-pagination__next">
                <svg width="7" height="10">
                    <use href="/img/icon-arrowRight.svg#arrowRight"></use>
                </svg>
            </span>
        @endif
        @include('site.components.pagination.cowSpot')
    </li>

</ul>