Generating slugs identical to Kirby's generated slugs

Let’s say I have a string “String with Umläüuts & special Chars // ß Test”, how can I transform this to a slug exactly to how kirby would generate a slug like this?
Like when you created a new Page and you put in the previously mentioned String into the title field.

Is there a existing function for it, or would I have to create my own regex for it/look through kirbys source code?

(Including having this in my config):

'slugs' => 'de',

There’s the Str::slug() method:

If you want to convert a value from a field, you could also use the $field->slug() method:

1 Like