A super simple, opinionated trait to add slugs to models in Laravel.
Via Composer
$ composer require codinglabsau/laravel-sluggable
This package watches for changes on the name
attribute, and automatically slugifies the slug column.
Add the Sluggable
trait to your user model:
use Codinglabs\Sluggable\Sluggable;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
use Sluggable;
}
Feel free to create a PR with tests!
If you discover any security related issues, create an issue on GitHub.
MIT. Please see the license file for more information.
Coding Labs is a web app development agency based on the Gold Coast, Australia. See our open source projects on our website.