Str slug laravel

PHP
use Illuminate\Support\Str;

$slug = Str::slug('Laravel 5 Framework', '-');

// laravel-5-frameworkphp artisan vendor:publish --provider="Cviebrock\EloquentSluggable\ServiceProvider"$ composer require cviebrock/eloquent-sluggable
Source

Also in PHP: