Devise\Search\Pagination::make PHP Method

make() public method

Makes a new paginated result from a collection
public make ( $collection, $page, $perPage )
$collection
$page
$perPage
    public function make($collection, $page, $perPage)
    {
        $this->perPage = $perPage;
        $this->appendsToLinkData = array();
        $this->appendsToLink = '';
        $this->page = $page;
        // get the total amount inside of this mixed collection
        $this->total = $collection->count();
        // we cut out the part of the collection we don't want (pseudo pagination)
        $this->items = $collection->slice(($page - 1) * $perPage, $perPage);
        // converts to real models
        $this->convertItemsToRealModel();
        // yep, it's fake... but it works
        return $this;
    }