public function __construct($count, $limit, $params = array())
{
// You can still pass an entire collection
if ($count instanceof Collection) {
$count = $count->count();
}
$this->options = array_merge(static::$defaults, $params);
$this->count = (int) $count;
$this->limit = (int) $limit;
$this->pages = (int) ceil($this->count / $this->limit);
$this->offset = (int) (($this->page() - 1) * $this->limit);
}