/** * Get all urls in an array. * * @param \Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator * @param bool $full Return the full version of the URL in for the first page * Ex. /users/page/1 instead of /users * * @return array */ public function allUrls(LengthAwarePaginator $paginator, $full = false) { if (!$paginator->hasPages()) { return []; } $urls = []; for ($page = 1; $page <= $paginator->lastPage(); ++$page) { $urls[] = $this->pageUrl($page, $full); } return $urls; }