Weave 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

Sluggable Laravel Package

marshmallow/sluggable

A lightweight Laravel package that automatically generates clean, unique slugs for your Eloquent models. Easily customize the source field, separator, and update behavior, with built-in duplicate handling to keep URLs SEO-friendly and readable. Ideal for blogs, products, and any model needing stable...

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. marshmallow/sluggable is a thin, conventional Laravel package: a trait plus a publishable migration and service provider that lets an Eloquent model persist a slug and resolve route bindings by it. That is a low-coupling pattern and fits cleanly into a standard Laravel MVC or modular monolith, sitting alongside Route::resource and implicit model binding. Two caveats matter architecturally. First, the description's framing around "Laravel Resources" is ambiguous — if it means API Resources (the presentation layer), storing slugs there would be the wrong layer; slugs belong on the persistence model. Confirm the package attaches to Eloquent models, not JsonResource classes. Second, this is a solved problem: spatie/laravel-sluggable and hand-rolled Str::slug + getRouteKeyName() already cover the majority of cases, so the package must earn its place through ergonomics rather than capability.

Integration feasibility. Mechanically simple: composer require, auto-discovered provider, publish config/migration, add trait, declare the slug source column. Realistic effort is well under a sprint for a pilot model — roughly 1–3 developer days including tests, plus separate effort for backfilling existing rows and redirect handling. v1.12.0 changes nothing about this path; it is a constraint/test-matrix release, not an API change.

Technical risk. The dominant risk is maturity, not code. Zero stars and zero dependents means no production evidence, no third-party bug reports, no ecosystem pressure on the maintainer, and a single-maintainer bus factor. v1.12.0 is a mild positive signal — a second-time external contributor and automated dependency hygiene indicate the repo is not abandoned — but two merged PRs are not a support commitment, and the project still has no downstream consumers to surface breakage. Specific behaviors to validate before adoption:

  • Uniqueness strategy (DB unique index vs. application check) and collision suffixing (-2, -3) under concurrent writes.
  • Slug immutability policy when the source field changes — silent regeneration breaks URLs and SEO.
  • Scoped uniqueness (per tenant, per parent category, per locale) and soft-delete interaction.
  • Unicode/transliteration behavior and DB collation case sensitivity.
  • Backfill tooling for existing tables and index strategy on large datasets.
  • Laravel/PHP version support matrix, test coverage, CI status, and static analysis.
  • New: whether Laravel 13 support in v1.12.0 is CI-verified against an actual L13 install or merely a widened illuminate/* constraint. An untested constraint bump is worse than no bump, because it invites installation on an unsupported combination.

Key questions. Is it model-level or resource-level? Does it hook resolveRouteBinding and support Route::bind overrides? What happens on duplicate slug — exception, silent overwrite, or suffixed retry? Is there a documented redirect/301 story for changed slugs? Who maintains it, and is there a published support commitment? Is there a CI job that actually exercises Laravel 13, and what is the tested PHP range for it? How does it differ materially from Spatie's package, and what's the exit cost if it's abandoned?

Integration Approach

Stack fit. Assumes a modern Laravel application using Composer with package auto-discovery, a relational database, and standard Eloquent routing. As of v1.12.0 the supported window extends to roughly Laravel 10–13, PHP 8.1+ (confirm the exact floor for L13 before relying on it). It remains a poor fit for apps that route exclusively by UUID/ULID, or that treat slugs as a derived read-model rather than a stored attribute.

Migration path. Do not start with Product or Page. Pilot on a low-traffic, low-cardinality model such as Tag or Category in a feature branch, then staging. Keep the existing ID-based or UUID-based URLs resolving in parallel (both id and slug accepted by resolveRouteBinding) until redirects are proven. Only after the pilot is green should the pattern extend to revenue- or SEO-critical models. If you are already on Laravel 13, the pilot is now the only way to validate the new support claim; if you are on 10–12, v1.12.0 is a no-op for you and there is no urgency to upgrade.

Compatibility. Pin the exact version in composer.json rather than a caret range; with zero dependents there is no downstream signal that a patch release is safe. A minor version that only widens framework constraints is low-risk, but it also means the package is now asserting compatibility it may not exercise — treat the L13 claim as unverified until your own smoke test passes. Verify illuminate/* constraints against your framework version, confirm the migration is additive and reversible, and check for conflicts if spatie/laravel-sluggable is already installed transitively. Validate behavior on your actual database driver, since unique-index collation and case sensitivity differ between MySQL and PostgreSQL.

Sequencing.

  1. Spike: install in a sandbox branch, read the source (it is small), and observe trait behavior on create, update, and delete.
  2. ADR: compare against Spatie and a 30-line in-house trait; record the decision explicitly.
  3. Pilot: one model, nullable slug column, unique index, feature-flagged route binding.
  4. Backfill: chunked job with idempotent slug generation, then tighten the column to non-null.
  5. Redirects: 301 map from legacy identifiers, plus monitoring of 404 rates.
  6. Rollout: repeat per model, gated on pilot metrics.

Operational Impact

Maintenance. Treat this as a vendored dependency under active watch rather than a trusted platform component. v1.12.0 shows the lights are on — a community PR merged, Dependabot running — which marginally improves the abandonment outlook, but the release contains no bug fixes or security content, so do not read it as evidence of responsiveness on defect reports. Add it to the dependency-review list, subscribe to releases, and consider forking internally so a patch can be shipped if the upstream maintainer goes quiet. The cheapest insurance is a narrow internal seam — one trait or service that wraps slug generation — so replacing the package later is a one-file change.

Support. Effectively no external support channel: no meaningful issue history, no community, no documented SLA. The first external contributor is encouraging but is not a succession plan. Internal ownership must be assigned before adoption; assume the adopting team is the maintainer of last resort.

Scaling. Slug lookups are point reads on an indexed column, so read scaling is fine. The pressure points are write-side uniqueness checks (rely on the database constraint, not an application-level exists() query, which races) and backfilling large tables, which needs chunking and, on MySQL, online DDL to avoid locking. For high-traffic sites, cache the slug-to-primary-key mapping rather than hitting the DB per request.

Failure modes to instrument.

  • Duplicate slug on concurrent create surfacing as a 500 from the unique constraint.
  • Silent slug regeneration on title edit producing dead links and SEO loss.
  • Legacy rows with null slugs returning 404 after route binding flips.
  • Slug reuse after soft delete, resurrecting stale URLs.
  • Ambiguous binding when the same slug exists across models or tenants.
  • Case- or accent-mismatched lookups due to collation differences between app and database.
  • Installing on Laravel 13 on the strength of the v1.12.0 note when the combination was never exercised in upstream CI.

Ramp-up. A mid-level Laravel developer will be productive with this package in under an hour; the API surface is small and idiomatic. The real ramp-up cost is organizational: agreeing on slug immutability, redirect ownership, and backfill runbooks. Budget senior review for the first migration and for the redirect policy, and write a short internal convention doc — source field, regeneration rules, uniqueness scope, and legacy-URL handling — before the second model adopts it.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console