spatie/laravel-sluggable
Generate slugs when saving Eloquent models
4.0.3
14M downloads/mo
#1004 most downloaded on Packagist
spatie/laravel-sluggable
What this package is like to depend on
Last release 26 days ago
28 Jul 2026
Release timing varies
gaps range from 2 weeks to 10 months
Most releases are documented
notes for 53 of 59 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
59 releases · first in 2015
5 releases in the last 12 months
see the full history below
Release timeline
59 releases · Dec 2015 to Jul 2026Releases
latest 59-
4.0.328 Jul 2026Release notes
Open source →What's Changed
-
Fix unique slug generation when the slug or separator contains a
LIKEwildcard (_,%,\) by @amrachraf6699 in #311On drivers without a default
LIKEescape character (SQLite), the slug-variant lookup silently matched nothing, so a separator like_caused suffixes to be reused (foo_bar_1twice instead offoo_bar_2).
Full Changelog: 4.0.2...4.0.3
Release notes
Open source →What's Changed
-
Fix unique slug generation when the slug or separator contains a
LIKEwildcard (_,%,\) by @amrachraf6699 in https://github.com/spatie/laravel-sluggable/pull/311On drivers without a default
LIKEescape character (SQLite), the slug-variant lookup silently matched nothing, so a separator like_caused suffixes to be reused (foo_bar_1twice instead offoo_bar_2).
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/4.0.2...4.0.3
-
-
4.0.129 Apr 2026Release notes
Open source →Full Changelog: https://github.com/spatie/laravel-sluggable/compare/4.0.0...4.0.1
-
4.0.027 Apr 2026Release notes
Open source →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 theHasSlugtrait. 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 a308(was301) soPUT/PATCH/DELETEkeep 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-translatablev6+ when usingHasTranslatableSlug. Pest 4 / Testbench 10+ in your test suite. skipGenerateWhen()is now evaluated on every save instead of once. TheSlugOptions::\$skipGenerateboolean is gone in favor of\$skipGenerateWhen.- The closure-shaped options (
generateSlugsFrom,extraScope,usingSuffixGenerator,skipGenerateWhen) are typed asClosure. Array/string callables need wrapping in afn. HasSlugno longer keeps aprotected \$slugOptionscache; overridegenerateSlugAction()to inject custom behavior instead.- Self-healing redirects default to
308 Permanent Redirect. - The
Sluggablefacade was renamed toSelfHealing.
See UPGRADING.md for migration steps.
Release notes
Open source →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 theHasSlugtrait. 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 a308(was301) soPUT/PATCH/DELETEkeep 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-translatablev6+ when usingHasTranslatableSlug. Pest 4 / Testbench 10+ in your test suite. skipGenerateWhen()is now evaluated on every save instead of once. TheSlugOptions::\$skipGenerateboolean is gone in favor of\$skipGenerateWhen.- The closure-shaped options (
generateSlugsFrom,extraScope,usingSuffixGenerator,skipGenerateWhen) are typed asClosure. Array/string callables need wrapping in afn. HasSlugno longer keeps aprotected \$slugOptionscache; overridegenerateSlugAction()to inject custom behavior instead.- Self-healing redirects default to
308 Permanent Redirect. - The
Sluggablefacade was renamed toSelfHealing.
See UPGRADING.md for migration steps.
-
3.8.123 Mar 2026Release notes
Open source →What's Changed
- Fix
preventOverwritefor translatable slugs (#304)
Thanks to @jyrkidn for reporting and providing the initial fix in #302.
Release notes
Open source →What's Changed
- Fix
preventOverwritefor translatable slugs (#304)
Thanks to @jyrkidn for reporting and providing the initial fix in #302.
- Fix
-
3.8.021 Feb 2026Release notes
Open source →What's Changed
- Add Laravel 13 and PHP 8.5 support
- Drop Laravel 8/9 and PHP 8.0/8.1 (EOL)
Release notes
Open source →What's Changed
- Add Laravel 13 and PHP 8.5 support
- Drop Laravel 8/9 and PHP 8.0/8.1 (EOL)
-
3.7.524 Apr 2025Release notes
Open source →What's Changed
- Also account for HasManyThrough / BelongsToMany relations by @mabdullahsari in #291
New Contributors
- @mabdullahsari made their first contribution in #291
Full Changelog: 3.7.4...3.7.5
Release notes
Open source →What's Changed
- Also account for HasManyThrough / BelongsToMany relations by @mabdullahsari in https://github.com/spatie/laravel-sluggable/pull/291
New Contributors
- @mabdullahsari made their first contribution in https://github.com/spatie/laravel-sluggable/pull/291
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.4...3.7.5
-
3.7.428 Feb 2025Release notes
Open source →What's Changed
- Allow to generate custom suffixes by @josepdecid in #289
New Contributors
- @josepdecid made their first contribution in #289
Full Changelog: 3.7.3...3.7.4
Release notes
Open source →What's Changed
- Allow to generate custom suffixes by @josepdecid in https://github.com/spatie/laravel-sluggable/pull/289
New Contributors
- @josepdecid made their first contribution in https://github.com/spatie/laravel-sluggable/pull/289
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.3...3.7.4
-
3.7.320 Feb 2025Release notes
Open source →What's Changed
- Bump dependabot/fetch-metadata from 2.2.0 to 2.3.0 by @dependabot in #287
- Laravel 12.x Compatibility by @laravel-shift in #288
Full Changelog: 3.7.2...3.7.3
Release notes
Open source →What's Changed
- Bump dependabot/fetch-metadata from 2.2.0 to 2.3.0 by @dependabot in https://github.com/spatie/laravel-sluggable/pull/287
- Laravel 12.x Compatibility by @laravel-shift in https://github.com/spatie/laravel-sluggable/pull/288
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.2...3.7.3
-
3.7.230 Dec 2024Release notes
Open source →What's Changed
- Fix query for translatable slug by @andrii-trush in #285
New Contributors
- @andrii-trush made their first contribution in #285
Full Changelog: 3.7.1...3.7.2
Release notes
Open source →What's Changed
- Fix query for translatable slug by @andrii-trush in https://github.com/spatie/laravel-sluggable/pull/285
New Contributors
- @andrii-trush made their first contribution in https://github.com/spatie/laravel-sluggable/pull/285
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.1...3.7.2
-
3.7.123 Dec 2024Release notes
Open source →What's Changed
- Add explicit nullable type for additionalQuery parameter by @RomkaLTU in https://github.com/spatie/laravel-sluggable/pull/286
New Contributors
- @RomkaLTU made their first contribution in https://github.com/spatie/laravel-sluggable/pull/286
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.7.0...3.7.1
-
3.7.009 Dec 2024Release notes
Open source →What's Changed
- Changing reference to Laravel docs without Laravel version by @abishekrsrikaanth in https://github.com/spatie/laravel-sluggable/pull/274
- Bump dependabot/fetch-metadata from 1.6.0 to 2.1.0 by @dependabot in https://github.com/spatie/laravel-sluggable/pull/278
- Bump dependabot/fetch-metadata from 2.1.0 to 2.2.0 by @dependabot in https://github.com/spatie/laravel-sluggable/pull/281
- Add Fallback Locale and Additional Query Support to
findBySlugby @mkeremcansev in https://github.com/spatie/laravel-sluggable/pull/284
New Contributors
- @abishekrsrikaanth made their first contribution in https://github.com/spatie/laravel-sluggable/pull/274
- @mkeremcansev made their first contribution in https://github.com/spatie/laravel-sluggable/pull/284
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.6.0...3.7.0
-
3.6.026 Feb 2024Release notes
Open source →What's Changed
- Bump dependabot/fetch-metadata from 1.4.0 to 1.5.1 by @dependabot in https://github.com/spatie/laravel-sluggable/pull/257
- Bump dependabot/fetch-metadata from 1.5.1 to 1.6.0 by @dependabot in https://github.com/spatie/laravel-sluggable/pull/261
- Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/spatie/laravel-sluggable/pull/264
- Add laravel 11 support by @mokhosh in https://github.com/spatie/laravel-sluggable/pull/271
New Contributors
- @mokhosh made their first contribution in https://github.com/spatie/laravel-sluggable/pull/271
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.5.0...3.6.0
-
3.5.029 May 2023Release notes
Open source →What's Changed
- Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 by @dependabot in https://github.com/spatie/laravel-sluggable/pull/250
- Fix badge with
buildstatus inREADME.mdby @gomzyakov in https://github.com/spatie/laravel-sluggable/pull/252 - Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0 by @dependabot in https://github.com/spatie/laravel-sluggable/pull/255
- feat: add findBySlug alias by @IsraelOrtuno in https://github.com/spatie/laravel-sluggable/pull/256
New Contributors
- @gomzyakov made their first contribution in https://github.com/spatie/laravel-sluggable/pull/252
- @IsraelOrtuno made their first contribution in https://github.com/spatie/laravel-sluggable/pull/256
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.4.2...3.5.0
-
3.4.223 Jan 2023 -
3.4.107 Dec 2022Release notes
Open source →What's Changed
- Update README.md by @furiouskj in https://github.com/spatie/laravel-sluggable/pull/240
- composer allow-plugins config by @hotsaucejake in https://github.com/spatie/laravel-sluggable/pull/241
- Normalize composer.json by @patinthehat in https://github.com/spatie/laravel-sluggable/pull/247
- Add Dependabot Automation by @patinthehat in https://github.com/spatie/laravel-sluggable/pull/246
- Add PHP 8.2 Support by @patinthehat in https://github.com/spatie/laravel-sluggable/pull/245
- Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/spatie/laravel-sluggable/pull/248
- Allow set slug suffix starting number by @Vediovis in https://github.com/spatie/laravel-sluggable/pull/249
New Contributors
- @furiouskj made their first contribution in https://github.com/spatie/laravel-sluggable/pull/240
- @hotsaucejake made their first contribution in https://github.com/spatie/laravel-sluggable/pull/241
- @dependabot made their first contribution in https://github.com/spatie/laravel-sluggable/pull/248
- @Vediovis made their first contribution in https://github.com/spatie/laravel-sluggable/pull/249
Full Changelog: https://github.com/spatie/laravel-sluggable/compare/3.4.0...3.4.1
-
3.4.028 Mar 2022Nothing published for this version
-
3.3.109 Mar 2022Nothing published for this version
-
3.3.013 Jan 2022 -
3.2.015 Dec 2021Nothing published for this version
-
3.1.113 Dec 2021Nothing published for this version
-
3.1.004 Jun 2021 -
3.0.207 May 2021 -
3.0.122 Apr 2021 -
3.0.026 Mar 2021Release notes
Open source →- require PHP 8+
- drop support for PHP 7.x
- convert syntax to PHP 8
- move Exceptions to
Exceptionsfolder to match structure of other packages
-
2.6.220 Mar 2021 -
2.6.131 Jan 2021 -
2.6.028 Oct 2020 -
2.5.201 Oct 2020 -
2.5.108 Sep 2020 -
2.5.015 Jun 2020 -
2.4.220 Apr 2020Release notes
Open source →- fix bug that causes empty slugs when dealing with multi-bytes chars (#152)
-
2.4.109 Apr 2020 -
2.4.003 Mar 2020 -
2.3.006 Dec 2019 -
2.2.206 Apr 2020Nothing published for this version
-
2.2.116 Sep 2019 -
2.2.004 Sep 2019 -
2.1.808 Jun 2019 -
2.1.727 Feb 2019 -
2.1.614 Feb 2019 -
2.1.510 Jan 2019 -
2.1.428 Aug 2018 -
2.1.315 Feb 2018 -
2.1.208 Feb 2018 -
2.1.128 Jan 2018 -
2.1.013 Sep 2017 -
2.0.030 Aug 2017Release notes
Open source →- add support for Laravel 5.5, drop support for all older versions of the framework
-
1.5.208 May 2018 -
1.5.119 Aug 2017 -
1.5.013 Apr 2017 -
1.4.112 Apr 2017 -
1.4.024 Jan 2017 -
1.3.014 Nov 2016 -
1.2.013 Jun 2016 -
1.1.024 Jan 2016 -
1.0.212 Jan 2016 -
1.0.127 Dec 2015 -
1.0.024 Dec 2015 -
0.0.124 Dec 2015Nothing published for this version