src/Support/Collection.php
/**
     * Sort through each item with a callback.
     *
     * @param callable|null  $callback
     * @return static
     */
Sort through each item with a callback.
@param callable|null  $callback
@return static
Sort through each item with a callback . @param callable|null $callback @return static
public function sort(callable $callback = null)
    {
        $items = $this->items;
        $callback
            ? uasort($items, $callback)
            : asort($items);
        return new static($items);
    }
public function sort ( callable $ callback = null ) { $ items = $ this -> items ; $ callback ? uasort ( $ items , $ callback ) : asort ( $ items ) ; return new static ( $ items ) ; }
Sort through each item with a callback.
Sort through each item with a callback .