src/Traits/Strings.php
public static function kebabCase(string $input): string
    {
        $words = __::words(preg_replace("/['\x{2019}]/u", '', $input));

        return array_reduce(
            $words,
            function ($result, $word) use ($words) {
                $isFirst = __::first($words) === $word;

                return $result . (!$isFirst ? '-' : '') . __::toLower($word);
            },
            ''
        );
    }
public static function kebabCase(string $input): string
    {
        $words = __::words(preg_replace("/['\x{2019}]/u", '', $input));

        return array_reduce(
            $words,
            function ($result, $word) use ($words) {
                $isFirst = __::first($words) === $word;

                return $result . (!$isFirst ? '-' : '') . __::toLower($word);
            },
            ''
        );
    }
public static function kebabCase ( string $ input ) : string { $ words = __ :: words ( preg_replace ( "/['\x{2019}]/u" , '' , $ input ) ) ; return array_reduce ( $ words , function ( $ result , $ word ) use ( $ words ) { $ isFirst = __ :: first ( $ words ) === $ word ; return $ result . ( ! $ isFirst ? '-' : '' ) . __ :: toLower ( $ word ) ; } , '' ) ; }
Converts string to kebab case.

@link  https://en.wikipedia.org/wiki/Letter_case#Special_case_styles kebab case

@usage __::kebabCase('Foo Bar');
>> 'foo-bar'

@param string $input

@return string
Converts string to kebab case .