finds.dev← search

// the find

cocur/slugify

★ 2,897 · PHP · MIT · updated Nov 2025

Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.

A PHP library that turns strings into URL slugs, with transliteration tables for 30+ languages and bridges for Symfony, Laravel, Twig, ZF2, Nette/Latte and a couple others. For PHP devs who need slugs that don't mangle accented or non-Latin input, and who want the framework glue already written instead of hand-rolling iconv or a regex.

The core has no runtime dependency besides mbstring, so pulling it in doesn't drag anything else with it. Rulesets are composable and orderable per call, so you can resolve genuine conflicts (the README's own example: a with umlaut is 'ae' in German defaults but 'a' in Turkish) without forking the library. It's been running since 2012 and still gets PRs merged for new PHP versions (8.5 support landed last month), so the core transliteration logic is well-exercised.

Transliteration is just static JSON substitution tables, not Unicode normalization, so coverage of a language is only as good as whoever submitted that JSON file - and the maintainer says outright they don't speak most of the languages they ship rules for, so correctness is unverified for anything outside the common ones. The framework bridges have visibly rotted: the Symfony 3 example still uses AppKernel::registerBundles (pre-Flex), the Laravel bridge is the old facade/ServiceProvider pattern, and ZF2 support is for a framework nobody runs anymore - none of that looks like it's been touched in years even though the core keeps moving. There's no caching of repeated slugify() calls, so if you're slugifying the same strings often (e.g. regenerating URLs on every request) you're redoing the full rule pass every time.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →