src/help/docs/OutputController.php
public function pagination($start = 1, $length = 10)
	{
		// manually create paginator
		$data = array_map(function ($num) {
			return ['id' => $num, 'value' => "Item $num"];
		}, range(1, 100));
		$page = Paginator::resolveCurrentPage('page');
		$path = Paginator::resolveCurrentPath();
		$items = array_slice($data, abs($start - 1) + (($page - 1) * $length), $length);
		$paginator = new LengthAwarePaginator($items, count($data), $length, $page, [
			'path'     => $path,
			'pageName' => 'page',
		]);

		// append existing parameters
		$paginator->appends(Sketchpad::$params);

		// output
		return view('sketchpad::help/output/pagination', compact('items', 'paginator'));

	}
public function pagination($start = 1, $length = 10)
	{
		// manually create paginator
		$data = array_map(function ($num) {
			return ['id' => $num, 'value' => "Item $num"];
		}, range(1, 100));
		$page = Paginator::resolveCurrentPage('page');
		$path = Paginator::resolveCurrentPath();
		$items = array_slice($data, abs($start - 1) + (($page - 1) * $length), $length);
		$paginator = new LengthAwarePaginator($items, count($data), $length, $page, [
			'path'     => $path,
			'pageName' => 'page',
		]);

		// append existing parameters
		$paginator->appends(Sketchpad::$params);

		// output
		return view('sketchpad::help/output/pagination', compact('items', 'paginator'));

	}
public function pagination ( $ start = 1 , $ length = 10 ) { // manually create paginator $ data = array_map ( function ( $ num ) { return [ 'id' => $ num , 'value' => "Item $num" ] ; } , range ( 1 , 100 ) ) ; $ page = Paginator :: resolveCurrentPage ( 'page' ) ; $ path = Paginator :: resolveCurrentPath ( ) ; $ items = array_slice ( $ data , abs ( $ start - 1 ) + ( ( $ page - 1 ) * $ length ) , $ length ) ; $ paginator = new LengthAwarePaginator ( $ items , count ( $ data ) , $ length , $ page , [ 'path' => $ path , 'pageName' => 'page' , ] ) ; // append existing parameters $ paginator -> appends ( Sketchpad :: $ params ) ; // output return view ( 'sketchpad::help/output/pagination' , compact ( 'items' , 'paginator' ) ) ; }
Sketchpad is designed to work invisibly with pagination, by preserving URL variables between front and back end

@param int $start
@param int $length
Sketchpad is designed to work invisibly with pagination by preserving URL variables between front and back end