Laravel 8 slug {#collection-method}
slug
方法使用指定字符将字符串格式化为 URL 友好的格式:
use Illuminate\Support\Str;
$slug = Str::of('Laravel Framework')->slug('-');
// laravel-framework
slug
方法使用指定字符将字符串格式化为 URL 友好的格式:
use Illuminate\Support\Str;
$slug = Str::of('Laravel Framework')->slug('-');
// laravel-framework