src/Commands/Command.php
protected function getPerPageFromModelClass($modelClass) {
        // We need this empty model to grab perPage and perPageMax parameters
        $model = new $modelClass;

        // If Model::$perPage equals 0, then pagination is disabled
        if ($model->getPerPage() == 0) {
            return $modelClass::all();
        }

        // The number of items per page can be overriden as a query parameter
        $perPage = Request::input('perPage', $model->getPerPage());

        // We make sure the $perPage parameter is not higher than the maximum for this model
        if ($perPage > $model->getPerPageMax()) {
            $perPage = $model->getPerPageMax();
        }

        return $perPage;
    }
protected function getPerPageFromModelClass($modelClass) {
        // We need this empty model to grab perPage and perPageMax parameters
        $model = new $modelClass;

        // If Model::$perPage equals 0, then pagination is disabled
        if ($model->getPerPage() == 0) {
            return $modelClass::all();
        }

        // The number of items per page can be overriden as a query parameter
        $perPage = Request::input('perPage', $model->getPerPage());

        // We make sure the $perPage parameter is not higher than the maximum for this model
        if ($perPage > $model->getPerPageMax()) {
            $perPage = $model->getPerPageMax();
        }

        return $perPage;
    }
Returns an integer for pagination based on a model's class.

@param  string $modelClass A model's class.
@return int The number of items per page for the given model.