Khmer - Laravel
Carbon::setLocale('km'); // Khmer month names are automatically handled if ICU data present
Laravel automatically handles UTF-8 input, but you must ensure your HTML forms specify the correct encoding:
$string = preg_replace('/\s+/u', '-', trim($string)); // Replace spaces with hyphens $string = preg_replace('/[^\pKhmer\-]/u', '', $string); // Remove non-Khmer characters return mb_strtolower($string, 'UTF-8');
$this->attributes['slug'] = khmer_slug($value);
|