Str::slug alternative for hindi and arabic strings?
I use Str::slug to generate friendly URL's, however Str::slug() method returns null on arabic and hindi strings. Probably chinese, japanese, korean and those charsets too. For example: return Str::slug('मनोरंजन'); //null How can I solve this issue efficiently? I have faced this problem when I was working with Arabic language, so I've made the following function which solved the problem for me. function make_slug($string = null, $separator = "-") { if (is_null($string)) { return ""; } // Remove spaces from the beginning and from the end of the string $string = trim($string); // Lower case