public function getSortedValues($order = 'asc')
    {
        $values = $this->values->toArray();
        usort($values, function ($a, $b) use ($order) {
            $left = $a->getAttribute()->getSort();
            $right = $b->getAttribute()->getSort();

            if ($order == 'desc') {
                return ($left < $right) ? 1 : -1;
            }

            return ($left > $right) ? 1 : -1;
        });

        return $values;
    }
public function getSortedValues($order = 'asc')
    {
        $values = $this->values->toArray();
        usort($values, function ($a, $b) use ($order) {
            $left = $a->getAttribute()->getSort();
            $right = $b->getAttribute()->getSort();

            if ($order == 'desc') {
                return ($left < $right) ? 1 : -1;
            }

            return ($left > $right) ? 1 : -1;
        });

        return $values;
    }
public function getSortedValues ( $ order = 'asc' ) { $ values = $ this -> values -> toArray ( ) ; usort ( $ values , function ( $ a , $ b ) use ( $ order ) { $ left = $ a -> getAttribute ( ) -> getSort ( ) ; $ right = $ b -> getAttribute ( ) -> getSort ( ) ; if ( $ order == 'desc' ) { return ( $ left < $ right ) ? 1 : - 1 ; } return ( $ left > $ right ) ? 1 : - 1 ; } ) ; return $ values ; }
Get Sorted Values

This method wraps all values in an array, sorted by the attribute's sort
property.

We use this to render a whole set of form types, which should be displayed
in some order. When you want to be able to get a form field by it's name
and place it on a custom place, use the getNamedValues() method.

@param  string $order

@return array
Get Sorted Values