use Illuminate\Support\Str; $all_data->slug = Str::slug($request->title, '-');