Looking to hire Laravel developers? Try LaraJobs

laravel-auto-slug maintained by tarekhasan

Description
Automatically generate and manage unique slugs for Eloquent models
Author
Last update
2025/04/19 19:10 (dev-main)
License
Links
Downloads
1

Comments
comments powered by Disqus

🚀 Laravel Auto Slug

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).