src/Illuminate/Pagination/UrlWindow.php
protected function getUrlSlider($onEachSide)
	{
		$window = $onEachSide * 2;

		if ( ! $this->hasPages())
		{
			return [
				'first'  => null,
				'slider' => null,
				'last'   => null,
			];
		}

		// If the current page is very close to the beginning of the page range, we will
		// just render the beginning of the page range, followed by the last 2 of the
		// links in this list, since we will not have room to create a full slider.
		if ($this->currentPage() <= $window)
		{
			return $this->getSliderTooCloseToBeginning($window);
		}

		// If the current page is close to the ending of the page range we will just get
		// this first couple pages, followed by a larger window of these ending pages
		// since we're too close to the end of the list to create a full on slider.
		elseif ($this->currentPage() > ($this->lastPage() - $window))
		{
			return $this->getSliderTooCloseToEnding($window);
		}

		// If we have enough room on both sides of the current page to build a slider we
		// will surround it with both the beginning and ending caps, with this window
		// of pages in the middle providing a Google style sliding paginator setup.
		return $this->getFullSlider($onEachSide);
	}
protected function getUrlSlider($onEachSide)
	{
		$window = $onEachSide * 2;

		if ( ! $this->hasPages())
		{
			return [
				'first'  => null,
				'slider' => null,
				'last'   => null,
			];
		}

		// If the current page is very close to the beginning of the page range, we will
		// just render the beginning of the page range, followed by the last 2 of the
		// links in this list, since we will not have room to create a full slider.
		if ($this->currentPage() <= $window)
		{
			return $this->getSliderTooCloseToBeginning($window);
		}

		// If the current page is close to the ending of the page range we will just get
		// this first couple pages, followed by a larger window of these ending pages
		// since we're too close to the end of the list to create a full on slider.
		elseif ($this->currentPage() > ($this->lastPage() - $window))
		{
			return $this->getSliderTooCloseToEnding($window);
		}

		// If we have enough room on both sides of the current page to build a slider we
		// will surround it with both the beginning and ending caps, with this window
		// of pages in the middle providing a Google style sliding paginator setup.
		return $this->getFullSlider($onEachSide);
	}
protected function getUrlSlider ( $ onEachSide ) { $ window = $ onEachSide * 2 ; if ( ! $ this -> hasPages ( ) ) { return [ 'first' => null , 'slider' => null , 'last' => null , ] ; } // If the current page is very close to the beginning of the page range, we will // just render the beginning of the page range, followed by the last 2 of the // links in this list, since we will not have room to create a full slider. if ( $ this -> currentPage ( ) <= $ window ) { return $ this -> getSliderTooCloseToBeginning ( $ window ) ; } // If the current page is close to the ending of the page range we will just get // this first couple pages, followed by a larger window of these ending pages // since we're too close to the end of the list to create a full on slider. elseif ( $ this -> currentPage ( ) > ( $ this -> lastPage ( ) - $ window ) ) { return $ this -> getSliderTooCloseToEnding ( $ window ) ; } // If we have enough room on both sides of the current page to build a slider we // will surround it with both the beginning and ending caps, with this window // of pages in the middle providing a Google style sliding paginator setup. return $ this -> getFullSlider ( $ onEachSide ) ; }
Create a URL slider links.

@param  int  $onEachSide
@return array
Create a URL slider links .