src/Repositories/Repository.php
public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null)
    {
        /* Strip param page from URL */
        $url = preg_replace('/&?page=[^&]*/', '', Request::fullUrl());
        
        $paginate = $this->builder->paginate($perPage, $columns, $pageName, $page);
        $paginate->setPath($url);
        return $paginate;
    }
public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null)
    {
        /* Strip param page from URL */
        $url = preg_replace('/&?page=[^&]*/', '', Request::fullUrl());
        
        $paginate = $this->builder->paginate($perPage, $columns, $pageName, $page);
        $paginate->setPath($url);
        return $paginate;
    }
Paginate the given query into a simple paginator.

@param int $perPage
@param array $columns
@param string $pageName
@param int|null $page
@return \Illuminate\Contracts\Pagination\LengthAwarePaginator