Я использую это для создания имени пользователя на основе имени.Имя должно быть utf8, а имя пользователя - нет.Как я могу конвертировать utf8 в non utf8?
public static function createUsername ($name, $count = 0) {
$username = implode('.', explode(' ', strtolower($name)));
if ($count > 0) {
$username = $username . $count;
}
if (count(self::where('username', $username)->get()) > 0) {
self::createUsername($name, $count++);
}
return $username;
}