Illuminate\Database\Query\Builder::backupFieldsForCount PHP Method

backupFieldsForCount() protected method

Backup then remove some fields for the pagination count.
protected backupFieldsForCount ( ) : void
return void
    protected function backupFieldsForCount()
    {
        foreach (['orders', 'limit', 'offset', 'columns'] as $field) {
            $this->backups[$field] = $this->{$field};
            $this->{$field} = null;
        }
        foreach (['order', 'select'] as $key) {
            $this->bindingBackups[$key] = $this->bindings[$key];
            $this->bindings[$key] = [];
        }
    }