gurzhii/laravel-sluggable-trait
Laravel Sluggable Trait
A trait you can apply to Eloquent models to have slugs automatically generated on save.
Installation
$ composer require gurzhii/laravel-sluggable-trait
Usage
<?php namespace App;
use Illuminate\Database\Eloquent\Model;
use MartinBean\Database\Eloquent\Sluggable;
class Item extends Model {
use Sluggable;
}
By default, the trait assumes your database has two columns: name and slug.
If you need to change these, you can do so via class constants:
<?php namespace App;
use Illuminate\Database\Eloquent\Model;
use MartinBean\Database\Eloquent\Sluggable;
class Item extends Model {
use Sluggable;
const DISPLAY_NAME = 'headline';
const SLUG = 'seo_url';
}
License
Licensed under the MIT Licence.
Related Packages
bpocallaghan/sluggable
Provides a HasSlug trait that will generate a unique slug when saving your Larav...
26,460
6
rinvex/laravel-categories
Rinvex Categories is a polymorphic Laravel package, for category management. You...
173,594
466
cviebrock/eloquent-sluggable
Easy creation of slugs for your Eloquent models in Laravel
15,264,232
3,997
jamalhassouni/laravel-sluggable
Easy creation of slugs for your Eloquent models in Laravel 5. support arabic
11
0
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.0.0 | >=5.4.0 | >=4.0 | MIT | |
| 0.2.0 | >=5.4.0 | >=4.0 | MIT |