Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.61 KB

README.md

File metadata and controls

48 lines (35 loc) · 1.61 KB

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.