Andreas Hunter
Andreas Hunter

Reputation: 5014

How to create part of my navigation?

Now I have this pagination code:

@if ($paginator->hasPages())
    <ul class="unstyled inbox-pagination">
        {{-- Previous Page Link --}}
        @if ($paginator->onFirstPage())
        <li>
            <a class="pl-15 pr-15"><i class="fa fa-angle-left  pagination-left"></i></a>
        </li>
        @else
        <li>
            <a class="pl-15 pr-15" href="{{ $paginator->previousPageUrl() }}"><i class="fa fa-angle-left  pagination-left"></i></a>
        </li>
        @endif

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

And my code nov take this result:

enter image description here

Pagination without numbers and "Next" - "Prev" buttons. Here how I can add count of messages and get simple result:

enter image description here

How I can add counts and get general result?

Upvotes: 0

Views: 27

Answers (1)

bahek2462774
bahek2462774

Reputation: 664

To get total

$paginator->total()

To get the first item

$paginator->firstItem()

To get the last item

$paginator->lastItem()

Upvotes: 1

Related Questions