laravel sluggable
snippet in php

laravel sluggable

user896

$ composer require cviebrock/eloquent-sluggable

laravel sluggable

user4614

use Cviebrock\EloquentSluggable\Sluggable;

class Post extends Model
{
    use Sluggable;

    /**
     * Return the sluggable configuration array for this model.
     *
     * @return array
     */
    public function sluggable()
    {
        return [
            'slug' => [
                'source' => 'title'
            ]
        ];
    }
}

laravel sluggable

user9315

$ composer require cviebrock/eloquent-sluggable