Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Sluggable Laravel Package

spatie/laravel-sluggable

Automatically 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 and redirects.

View on GitHub
Deep Wiki
Context7
4.0.0

v4 is mostly additive. Breaking changes are limited to minimum versions and a small handful of API removals. Full details in UPGRADING.md.

Highlights

  • #[Sluggable] attribute as a drop-in alternative to the HasSlug trait. Trait-based models keep working unchanged.
  • Self-healing URLs: route keys that combine the slug with the primary key (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.
  • Overridable actions: swap the slug generator or self-healing URL builder/parser via config/sluggable.php.
  • Laravel Boost skill bundled with the package for AI assistants.

Breaking changes

  • Minimum PHP 8.3 and Laravel 12. 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.
  • The closure-shaped options (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.
  • Self-healing redirects default to 308 Permanent Redirect.
  • The Sluggable facade was renamed to SelfHealing.

See UPGRADING.md for migration steps.

3.8.1

What's Changed

  • Fix preventOverwrite for translatable slugs (#304)

Thanks to @jyrkidn for reporting and providing the initial fix in #302.

3.8.0

What's Changed

  • Add Laravel 13 and PHP 8.5 support
  • Drop Laravel 8/9 and PHP 8.0/8.1 (EOL)
3.7.5

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.4...3.7.5

3.7.4
3.7.3
3.7.2
3.7.1

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.0...3.7.1

3.7.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.6.0...3.7.0

3.6.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.5.0...3.6.0

3.5.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.4.2...3.5.0

3.4.2
  • update for Laravel 10
3.4.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.3.1...3.4.0

3.3.1

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.3.0...3.3.1

3.3.0
  • support Laravel 9
3.2.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.1.1...3.2.0

3.1.1
3.1.0
  • add extra scope callback option (#201)
3.0.2
  • bugfix for updating slugs generated from a callback (#200)
3.0.1
  • update slug on non unique names (#195)
3.0.0
  • require PHP 8+
  • drop support for PHP 7.x
  • convert syntax to PHP 8
  • move Exceptions to Exceptions folder to match structure of other packages
2.6.2
  • Added translatable slug overriding (#190)
2.6.1
  • fix Eloquent model checking (#186)
2.6.0
  • add preventOverwrite
  • add support for PHP 8
2.5.2
  • fixed an incompatibility bug with postgresql uuid column (#173)
2.5.1
  • add support for Laravel 8
2.5.0
  • add helper trait to integrate with laravel-translatable #155
2.4.2
  • fix bug that causes empty slugs when dealing with multi-bytes chars (#152)
2.4.1
  • use method for retrieving incrementing status of the model (#151)
2.2.2

L7

2.4.0
  • add support for Laravel 7, drop support for Laravel 6
2.3.0
  • drop support for anything below PHP 7.4 and Laravel 6
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony