Str slug laravel
use Illuminate\Support\Str;
$slug = Str::slug('Laravel 5 Framework', '-');
// laravel-5-framework
Zany Zebra
use Illuminate\Support\Str;
$slug = Str::slug('Laravel 5 Framework', '-');
// laravel-5-framework
$ composer require cviebrock/eloquent-sluggable
$slug = Str::slug('Laravel 5 Framework', '-');
$slug = Str::slug($request->title);
public function setTitleAttribute($value)
{
$this->attributes['title'] = $value;
$this->attributes['slug'] = str_slug($value);
}
php artisan vendor:publish --provider="Cviebrock\EloquentSluggable\ServiceProvider"