master

laravel/framework

Last updated at: 29/12/2023 09:21

LengthAwarePaginator.php

TLDR

This file defines the LengthAwarePaginator interface, which extends the Paginator interface. It includes three methods: getUrlRange, total, and lastPage.

Methods

getUrlRange($start, $end)

This method creates a range of pagination URLs based on the given start and end values. It accepts two integer parameters, $start and $end, and returns an array of URLs.

total()

This method determines the total number of items in the data store. It returns an integer representing the total count.

lastPage()

This method retrieves the page number of the last available page. It returns an integer representing the last page number.

<?php

namespace Illuminate\Contracts\Pagination;

interface LengthAwarePaginator extends Paginator
{
    /**
     * Create a range of pagination URLs.
     *
     * @param  int  $start
     * @param  int  $end
     * @return array
     */
    public function getUrlRange($start, $end);

    /**
     * Determine the total number of items in the data store.
     *
     * @return int
     */
    public function total();

    /**
     * Get the page number of the last available page.
     *
     * @return int
     */
    public function lastPage();
}