Commit

2fdf781

πŸ”— A slug should be allowed to change without breaking the URL. Take a typical Laravel application: /articles/1523 Not particularly descriptive. It also exposes a sequential database ID. Or: /articles/understanding-laravel-routing Better for humans, but what happens when the title changes, the content gets translated, or someone shares an outdated URL? Polyslug for Laravel separates the human-readable slug from the model's identity. For example: /articles/understanding-laravel_aB3xK The slug is editable and language-specific. The encoded identifier remains stable. Here's what that enables: πŸ”„ Automatic canonical redirects Rename an article, product, or page. Old URLs continue resolving to the same model and automatically return a 301 redirect to the current canonical URL. 🌍 Multilingual URLs Maintain separate slugs for each locale, with canonical URLs and reciprocal hreflang references. πŸ”’ Opaque identifiers By default, models receive random, unguessable tokens instead of exposing sequential primary keys. Alternative encoders include Sqids, UUIDs, ULIDs, and custom implementations. 🧩 Polymorphic routing Route different Eloquent models through a shared content registry. Useful for applications with articles, products, pages, and other content types. βš™οΈ Flexible URL structures Use slugs with tokens, token-only URLs, or slug-only URLs. Configure uniqueness per tenant, locale, category, or other scopes. Polyslug also supports slug history, change events, immutable slugs, and optional integration with laravel/head for canonical tags, Open Graph locales, and indexability metadata. No manually maintained redirect tables for every renamed article. No dependency on the current slug to identify the underlying model. Readable URLs for humans. Stable identities for applications. Laravel 13+, PHP 8.4+, MIT licensed. https://github.com/pushery/polyslug-for-laravel

commit 2fdf781