public static function generateSlug($string)
    {
        $string = strtolower($string);
        $string = preg_replace('/([^a-z0-9]+)/', '-', $string);
        $string = str_replace('--', '-', $string);

        if (substr($string, 0, 1) == '-') {
            $string = substr($string, 1);
        }

        if (substr($string, -1) == '-') {
            $string = substr($string, 0, -1);
        }

        return $string;
    }