src/records/SortableTrait.php
protected function nextSortOrder(
        array $sortOrderCondition = [],
        string $sortOrderAttribute = 'sortOrder'
    ): int {
        $maxSortOrder = $this->sortOrderQuery(
            $sortOrderCondition,
            $sortOrderAttribute
        )->max('[[' . $sortOrderAttribute . ']]');

        return ++$maxSortOrder;
    }
protected function nextSortOrder(
        array $sortOrderCondition = [],
        string $sortOrderAttribute = 'sortOrder'
    ): int {
        $maxSortOrder = $this->sortOrderQuery(
            $sortOrderCondition,
            $sortOrderAttribute
        )->max('[[' . $sortOrderAttribute . ']]');

        return ++$maxSortOrder;
    }
protected function nextSortOrder ( array $ sortOrderCondition = [ ] , string $ sortOrderAttribute = 'sortOrder' ) : int { $ maxSortOrder = $ this -> sortOrderQuery ( $ sortOrderCondition , $ sortOrderAttribute ) -> max ( '[[' . $ sortOrderAttribute . ']]' ) ; return ++ $ maxSortOrder ; }
Get the next available sort order available

@param array $sortOrderCondition
@param string $sortOrderAttribute
@return int
Get the next available sort order available