{"repo":"nunomaduro/laravel-sluggable","free":true,"listed":false,"github":"https://github.com/nunomaduro/laravel-sluggable","clone":"git clone https://github.com/nunomaduro/laravel-sluggable.git","description":"Laravel Sluggable is my opinionated take on automatic slug generation for Eloquent models","language":"PHP","stars":152,"topics":["eloquent","laravel","models","slugs"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"------ Laravel Sluggable is my opinionated take on automatic slug generation for Eloquent models — the exact pattern I've reached for across projects like Laravel Cloud , now packaged up. A single #[Sluggable] attribute on the model is all you need. No trait, no base class, no extra wiring. It handles all of the weirdest edge cases you can think about; slugs collisions, Unicode and CJK transliteration, domain-aware dot preservation, scoped uniqueness (per-tenant, per-locale), multi-column sources, soft-deleted record collisions, and more. Requires PHP 8.5+ and Laravel 13.5+ Installation Getting Started To make an existing model sluggable, run the make:sluggable Artisan command: This command adds the #[Sluggable] attribute to your model and generates a migration for the slug column. It introspects the model's table to guess the source column ( name , title , headline , or subject ): It also generates a migration under database/migrations that adds the slug column: Review the migration before running it. The right shape depends on how you configured the attribute and the state of your existing data. For example, on a table with existing rows you typically want to use the - nullable() , etc. Once the migration is in shape, run: When a Post is created, a slug will be automatically generated and stored in the slug column: The command also accepts --from and --to options: Configuration Every aspect of slug generation can be customized directly on the attribute. from By default, the","default_branch":null,"files":null,"tree":[],"storefront":"/r/nunomaduro","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/nunomaduro/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."}