public static function sortByTermResemblance(array $array, $term)
    {
        $term = (string) s($term)->toLowerCase();
        usort($array, function ($a, $b) use ($term) {
            $aScore = s($a)->toLowerCase()->longestCommonPrefix($term)->length();
            $bScore = s($b)->toLowerCase()->longestCommonPrefix($term)->length();
            if ($aScore === $bScore) {
                return 0;
            }

            return $aScore > $bScore ? -1 : 1;
        });

        return $array;
    }