tarekhasan / laravel-auto-slug
Automatically generate and manage unique slugs for Eloquent models
v1.0.0
2025-04-19 16:02 UTC
README
Laravel Auto Slug is a lightweight, easy-to-use Laravel package that automatically generates and manages unique slugs for your Eloquent models.
Perfect for blog posts, products, or any content type that needs clean, human-readable, SEO-friendly URLs.
๐ฆ Installation
composer require tarekhasan/laravel-auto-slug --- ## โ๏ธ Usage ```use Illuminate\Database\Eloquent\Model; use Tarekhasan\LaravelAutoSlug\Traits\AutoSlug; class Post extends Model { use AutoSlug; protected static function booted() { static::bootAutoSlug('title'); } } --- ## ๐ง Features โ Automatically generates slugs for any Eloquent model field โ Ensures uniqueness even if titles are duplicated โ Simple and expressive syntax โ Fully customizable slug source field โ Works out-of-the-box with Laravel **8, 9, 10, and 11** --- ## ๐งช Coming Soon - Support for localized slugs - Optional slug column name configuration - Slug regeneration control on updates --- ## ๐ License Released under the [MIT license](LICENSE). Made with โค๏ธ by [Tarek Hasan](mailto:tarekhn175@gmail.com) --- ## ๐ Contributing PRs and stars are welcome! If you find this package useful, consider giving it a โญ๏ธ on [GitHub](https://github.com/tarekhn/laravel-auto-slug).