laravel slug 1

laravel slug

use Illuminate\Support\Str;

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

// laravel-5-framework

Here is what the above code is Doing:
1. We’re using the Str::slug method to convert the string to a URL friendly string.
2. The second argument is the separator.
3. The third argument is the language.

Similar Posts