u/nunomaduro

Just released Laravel Sluggable
▲ 34 r/laravel

Just released Laravel Sluggable

Hi r/laravel,

I built a package called Laravel Sluggable; it's basically my opinionated take on automatic slug generation for Eloquent models.

It's the exact pattern I've ended up using across a bunch of projects (including Laravel Cloud), and I finally wrapped it up into a package.

Usage is intentionally minimal: just drop a single #[Sluggable] attribute on your model and you're done. No traits, no base classes, no extra wiring.

It handles a lot of the annoying edge cases out of the box: slug collisions (even with soft-deleted models), Unicode + CJK transliteration, scoped uniqueness (per-tenant, per-locale), multi-column sources, etc.

Let me know what you think.

github.com
u/nunomaduro — 4 days ago