josezenem/laravel-slugidable
Automatically generate unique, URL-friendly slugs for your Eloquent models. Customize the source field, separator, and length, and let the package handle duplicates and slug updates when records change, keeping every route clean and consistent.
/blog/my-post), ID-only (/blog/12345), and the hybrid this package implements (/blog/my-post-12345). The hybrid is the "safe middle": readable and keyword-bearing for SEO, yet collision-proof and stable when editors retitle content.spatie/laravel-sluggable / cviebrock/eloquent-sluggable, or write a 30-line trait." This package's only differentiation is the title+ID composition; the underlying mechanics are commodity. Scope the decision as "do we specifically need the ID-suffixed pattern, and if so, is 11 stars / single maintainer acceptable?"Consider it when:
Look elsewhere when:
spatie/laravel-sluggable has orders of magnitude more adoption, active maintenance, and broader features. Choose this package only if the ID-suffix behavior is a requirement, not a convenience.Recommended framing for the decision record: "Adopt behind an internal abstraction, or reimplement the ~40 lines ourselves." Given the surface area, either is defensible; the package's value is mostly in encoding the convention, not in hard engineering.
For executives (30 seconds): We have a recurring, low-grade content bug: when an editor fixes a title, the public URL either breaks or has to stay ugly, and duplicate titles create collisions. This package removes that class of bug by generating URLs as readable-title-plus-ID — human-friendly for search and sharing, permanently stable, never duplicated. The integration is small and reversible: a trait on the model, no infrastructure, no new service, no vendor lock-in — we can replace it in an afternoon if needed. Cost is effectively zero; the return is fewer broken links, cleaner search indexing, and editors who don't have to think about URLs.
For engineering (the honest version): It's a thin Eloquent trait that composes Str::slug(title) with the primary key. Low risk because it's narrow and swappable; the real risk is dependency hygiene — 11 stars, one maintainer, no evident security process. So: pin the version, vendor or reimplement if the audit is unfriendly, and put our own tests around slug generation. Do not treat it as the answer to slug history, localization, or redirects — those are separate roadmap items. If we don't specifically need the ID suffix, spatie/laravel-sluggable is the lower-variance default and this decision should be framed as "why not Spatie" rather than "why this package."
The one-line ask: Approve a timeboxed spike (half a day) to validate the package against our models and Laravel version; if it holds, adopt behind an internal interface; if not, we implement the convention ourselves and lose roughly a day.
How can I help you explore Laravel packages today?