src/Pagination/Paginator.php
protected function calculateLastPage()
    {
        if (empty($this->total)) {
            $this->lastPage = 0;
            return;
        }

        if (empty($this->perPage)) {
            throw new \RuntimeException('Cannot calculate last page. Insufficient data');
        }

        $this->lastPage = (int) ceil($this->total / $this->perPage);
    }
protected function calculateLastPage()
    {
        if (empty($this->total)) {
            $this->lastPage = 0;
            return;
        }

        if (empty($this->perPage)) {
            throw new \RuntimeException('Cannot calculate last page. Insufficient data');
        }

        $this->lastPage = (int) ceil($this->total / $this->perPage);
    }
protected function calculateLastPage ( ) { if ( empty ( $ this -> total ) ) { $ this -> lastPage = 0 ; return ; } if ( empty ( $ this -> perPage ) ) { throw new \ RuntimeException ( 'Cannot calculate last page. Insufficient data' ) ; } $ this -> lastPage = ( int ) ceil ( $ this -> total / $ this -> perPage ) ; }
Calculate the last page based on the current values.
Calculate the last page based on the current values .