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

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • SEO & Content Management: Enables clean, human-readable URLs for blog posts, articles, products, or documentation, directly improving organic search performance and user experience.
  • Self-Healing URLs: Mitigates broken links when content titles are edited, reducing technical debt and improving reliability for public-facing content.
  • Multilingual Support: Facilitates translatable slugs for global applications, aligning with i18n roadmaps.
  • Developer Productivity: Reduces boilerplate for slug generation, allowing engineers to focus on core features. Laravel Boost integration further accelerates onboarding.
  • Build vs. Buy: Eliminates the need to reinvent slug logic, saving time and reducing maintenance overhead for a common but non-differentiating feature.
  • Data Integrity: Ensures unique slugs out of the box, reducing edge-case bugs in content-heavy applications.

When to Consider This Package

  • Adopt when:

    • Your product relies on SEO-friendly URLs (e.g., blogs, e-commerce, documentation).
    • Content titles are frequently edited, and broken links are a risk.
    • You need multilingual slugs or scoped uniqueness (e.g., tenant-specific slugs).
    • Your team prioritizes developer velocity and maintainability over custom slug logic.
    • You’re using Laravel and want a battle-tested, opinionated solution.
  • Look elsewhere if:

    • Your slugs are static (e.g., generated from IDs or fixed patterns) and don’t require dynamic generation.
    • You need slugs for non-Eloquent models (e.g., API resources, non-database entities).
    • Your application has strict performance constraints (e.g., high-frequency slug collisions requiring custom logic).
    • You’re not using Laravel or need a framework-agnostic solution (e.g., for PHP CLI tools).

How to Pitch It (Stakeholders)

For Executives: "This package automates the creation of clean, SEO-friendly URLs for our content (e.g., blog posts, products) while handling edge cases like title edits and duplicate slugs. It reduces technical debt by eliminating manual slug management and ensures a seamless user experience—critical for retention and organic growth. The self-healing feature alone saves hours of link-fix maintenance after content updates. With minimal setup, it’s a no-brainer for scaling our content platform."

For Engineers: *"Spatie’s laravel-sluggable gives us a robust, zero-boilerplate way to generate and manage slugs for Eloquent models. Key benefits:

  • Attribute-based setup: Add #[Sluggable] to any model in seconds (e.g., #[Sluggable(from: 'title', to: 'slug')]).
  • Self-healing URLs: Combine slugs with IDs ({slug}-{id}) to prevent broken links when titles change. Stale slugs redirect automatically.
  • Advanced use cases: Conditional slug generation, custom suffixes, scoped uniqueness, and translatable slugs—all via a fluent SlugOptions API.
  • Laravel Boost integration: AI tools (Copilot, Cursor) can scaffold sluggable models with a single prompt.
  • Battle-tested: Used by thousands of projects, with active maintenance.

It’s a drop-in solution that handles 90% of use cases out of the box, leaving us to focus on core features."*

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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai