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.
v4 is mostly additive. Breaking changes are limited to minimum versions and a small handful of API removals. Full details in UPGRADING.md.
#[Sluggable] attribute as a drop-in alternative to the HasSlug trait. Trait-based models keep working unchanged.hello-world-5) so renaming a model never breaks an existing link. Stale URLs return a 308 (was 301) so PUT/PATCH/DELETE keep working.config/sluggable.php.spatie/laravel-translatable v6+ when using HasTranslatableSlug. Pest 4 / Testbench 10+ in your test suite.skipGenerateWhen() is now evaluated on every save instead of once. The SlugOptions::\$skipGenerate boolean is gone in favor of \$skipGenerateWhen.generateSlugsFrom, extraScope, usingSuffixGenerator, skipGenerateWhen) are typed as Closure. Array/string callables need wrapping in a fn.HasSlug no longer keeps a protected \$slugOptions cache; override generateSlugAction() to inject custom behavior instead.308 Permanent Redirect.Sluggable facade was renamed to SelfHealing.See UPGRADING.md for migration steps.
preventOverwrite for translatable slugs (#304)Thanks to @jyrkidn for reporting and providing the initial fix in #302.
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.4...3.7.5
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.3...3.7.4
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.2...3.7.3
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.1...3.7.2
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.0...3.7.1
findBySlug by @mkeremcansev in https://github.com/spatie/laravel-sluggable/pull/284Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.6.0...3.7.0
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.5.0...3.6.0
build status in README.md by @gomzyakov in https://github.com/spatie/laravel-sluggable/pull/252Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.4.2...3.5.0
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.4.0...3.4.1
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.3.1...3.4.0
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.3.0...3.3.1
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.1.1...3.2.0
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.1.0...3.1.1
Exceptions folder to match structure of other packagespreventOverwritelaravel-translatable #155L7
How can I help you explore Laravel packages today?