From e395783ad982629a06f82c6a68198d890ff45932 Mon Sep 17 00:00:00 2001 From: Edson Famanda Date: Fri, 2 Jul 2021 10:54:15 +0200 Subject: [PATCH] Fixed Arr::Str on Laravel 8 Calling Arr::Str Helper, just after successfully install the package. --- 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..7273da0 100644 --- a/src/app/Models/Survey.php +++ b/src/app/Models/Survey.php @@ -3,6 +3,7 @@ namespace AidynMakhataev\LaravelSurveyJs\app\Models; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Str as Arr; use Illuminate\Database\Eloquent\SoftDeletes; 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 = Arr::Str($survey->name); $latestSlug = static::whereRaw("slug = '$survey->slug' or slug LIKE '$survey->slug-%'") ->latest('id')