Skip to content

Commit c8215d1

Browse files
authored
Changed str_slug to Str::slug
`str_slug` is deprecated in Laravel 7 and above
1 parent 9627a8e commit c8215d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/Models/Survey.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace AidynMakhataev\LaravelSurveyJs\app\Models;
44

5+
use Illuminate\Support\Str;
56
use Illuminate\Database\Eloquent\Model;
67
use Illuminate\Database\Eloquent\SoftDeletes;
78

@@ -25,7 +26,7 @@ public static function boot()
2526
parent::boot();
2627

2728
static::creating(function ($survey) {
28-
$survey->slug = str_slug($survey->name);
29+
$survey->slug = Str::slug($survey->name);
2930

3031
$latestSlug = static::whereRaw("slug = '$survey->slug' or slug LIKE '$survey->slug-%'")
3132
->latest('id')

0 commit comments

Comments
 (0)