# spatie/laravel-sluggable

An opinionated package to create slugs for Eloquent models

Repository: https://github.com/spatie/laravel-sluggable
Canonical: https://ross.abutalabs.com/products/laravel-sluggable
Homepage: https://spatie.be/docs/laravel-sluggable
Language: PHP
License: MIT
License Family: permissive
Topics: laravel, php, eloquent, model, slugify
Last push: 2026-07-28T13:28:24+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 94, release rhythm 83, longevity 100
- inputs: {"age_days": 3906, "days_push": 36, "days_rel": 36, "gap_med": 32.0, "n_releases_24m": 11}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1556, forks 191 (observed 2026-08-28T04:05:03.246494+00:00)

## What it is
A Laravel package that automatically generates unique, URL-friendly slugs for Eloquent models when they are created or updated. It supports a #[Sluggable] attribute or HasSlug trait, translatable slugs, and self-healing URLs that redirect stale slugs with a 308.

## Use cases
- generate url slugs for laravel models
- create seo-friendly urls from titles in laravel
- ensure unique slugs for eloquent records
- make slugs that survive model renames with redirects
- generate per-locale slugs for multilingual laravel apps
- bind laravel routes by slug instead of id

## When to choose
- you use Laravel/Eloquent and want automatic, unique slug generation
- you need translatable slugs for multilingual content
- you want self-healing URLs so renamed content doesn't break links

## When to avoid
- you don't use Laravel or Eloquent
- you need full control over slug generation outside the package's opinionated defaults
- you're on PHP < 8.3 or Laravel < 12

## Facets
- artifact type: library
- maturity: active
- function: orm
- domain: web-development, backend, developer-tools
- platform: php
- tags: laravel, eloquent, slugs, seo, url-generation, translatable, self-healing-urls

## Member repositories
- spatie/laravel-sluggable (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:03.246494+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:29:59.816769+00:00, confidence not recorded.
  - readme: https://github.com/spatie/laravel-sluggable (fetched 2026-08-28T04:05:03.246494+00:00, sha 58f72acc27b3)
  - homepage: https://spatie.be/docs/laravel-sluggable (fetched 2026-08-29T11:30:09.845325+00:00, sha e0631e63e0e3)
  - site_page: https://spatie.be/docs (fetched 2026-08-29T11:30:09.872155+00:00, sha 08e024d86d95)
  - site_page: https://spatie.be/about-us (fetched 2026-08-29T11:30:09.898894+00:00, sha d3cb88e4b34c)
  - site_page: https://spatie.be/docs/laravel-sluggable/v4 (fetched 2026-08-29T11:30:09.936025+00:00, sha ce52e24057e6)
  - site_page: https://spatie.be/docs/laravel-sluggable/v4/requirements (fetched 2026-08-29T11:30:10.076169+00:00, sha b8e70f6ec4bc)
  - site_page: https://spatie.be/docs/laravel-sluggable/v4/installation-setup (fetched 2026-08-29T11:30:10.200110+00:00, sha 5a35db5db189)
  - site_page: https://spatie.be/docs/laravel-sluggable/v4/translatable-slugs (fetched 2026-08-29T11:30:10.295507+00:00, sha 3fdb75ff856c)
  - site_page: https://spatie.be/docs/laravel-sluggable/v4/laravel-boost-skill (fetched 2026-08-29T11:30:10.341828+00:00, sha d35a624bf5ae)
  - site_page: https://spatie.be/docs/laravel-sluggable/v4/changelog (fetched 2026-08-29T11:30:10.363178+00:00, sha 092c3df32c3a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
