spatie/laravel-sluggable
Generate unique slugs for Eloquent models on create/update. Supports collision suffixes, translatable slugs, and customizable slug options. Includes self-healing URLs that keep old links working via slug+ID route keys with 308 redirects to the canonical URL.
Adopt when:
Look elsewhere if:
For Executives: "This package automates the creation of clean, SEO-friendly URLs for our content (e.g., blog posts, products) while handling edge cases like title edits and duplicate slugs. It reduces technical debt by eliminating manual slug management and ensures a seamless user experience—critical for retention and organic growth. The self-healing feature alone saves hours of link-fix maintenance after content updates. With minimal setup, it’s a no-brainer for scaling our content platform."
For Engineers:
*"Spatie’s laravel-sluggable gives us a robust, zero-boilerplate way to generate and manage slugs for Eloquent models. Key benefits:
#[Sluggable] to any model in seconds (e.g., #[Sluggable(from: 'title', to: 'slug')]).{slug}-{id}) to prevent broken links when titles change. Stale slugs redirect automatically.SlugOptions API.It’s a drop-in solution that handles 90% of use cases out of the box, leaving us to focus on core features."*
How can I help you explore Laravel packages today?