Skip to content

A super simple, opinionated trait to add slugs to models in Laravel.

License

Notifications You must be signed in to change notification settings

codinglabsau/laravel-sluggable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Sluggable

Build Status Latest Stable Version Total Downloads License

A super simple, opinionated trait to add slugs to models in Laravel.

Installation

Via Composer

$ composer require codinglabsau/laravel-sluggable

Usage

Add name and slug columns to your model

This package watches for changes on the name attribute, and automatically slugifies the slug column.

Add the trait

Add the Sluggable trait to your user model:

use Codinglabs\Sluggable\Sluggable;
use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    use Sluggable;
}

Contributing

Feel free to create a PR with tests!

Security

If you discover any security related issues, create an issue on GitHub.

Credits

License

MIT. Please see the license file for more information.

About Coding Labs

Coding Labs is a web app development agency based on the Gold Coast, Australia. See our open source projects on our website.