{"repo":"spatie/laravel-sluggable","free":true,"listed":false,"github":"https://github.com/spatie/laravel-sluggable","clone":"git clone https://github.com/spatie/laravel-sluggable.git","description":"An opinionated package to create slugs for Eloquent models","language":"PHP","stars":1556,"topics":["laravel","php","eloquent","model","slugify"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Generate slugs when saving Eloquent models This package generates a unique slug for any Eloquent model whenever it is created or updated. Add a #[Sluggable] attribute to the model and the package handles the rest. For features that need closures (custom source callables, scoped uniqueness, conditional skip, custom suffix generators) use the HasSlug trait with a getSlugOptions() method instead. Highlights - Unique slugs out of the box , with a configurable -1 , -2 , ... suffix on collisions. - 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 slugs return a 308 redirect to the canonical URL. - Translatable slugs through HasTranslatableSlug and spatie/laravel-translatable . - Overridable actions : swap the slug generator or the self-healing URL logic for your own class via a config file. - Laravel Boost skill bundled with the package, so AI assistants know how to scaffold sluggable models in your project. Boost discovers it automatically once both packages are installed. Self-healing URLs combine the slug with the primary key. The HasSlug trait is required alongside the attribute, because it overrides Eloquent's route key and route binding methods. Spatie is a web design agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website. Support us We invest a lot of resources into creating best in class open source packages. You can support u","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/laravel-sluggable/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}