From fd70888331407bfc741f00e9a82573787af64fa2 Mon Sep 17 00:00:00 2001 From: Oshane Bailey Date: Sun, 2 Jan 2022 21:23:05 -0500 Subject: [PATCH] Changed str_slug to Str::slug `str_slug` is deprecated in Laravel 7 and above --- src/app/Models/Survey.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/Models/Survey.php b/src/app/Models/Survey.php index dc21b81..f042f7f 100644 --- a/src/app/Models/Survey.php +++ b/src/app/Models/Survey.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +use Illuminate\Support\Str; class Survey extends Model { @@ -25,7 +26,7 @@ public static function boot() parent::boot(); static::creating(function ($survey) { - $survey->slug = str_slug($survey->name); + $survey->slug = Str::slug($survey->name); $latestSlug = static::whereRaw("slug = '$survey->slug' or slug LIKE '$survey->slug-%'") ->latest('id')