Skip to content

Commit fd70888

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

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/Models/Survey.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Database\Eloquent\Model;
66
use Illuminate\Database\Eloquent\SoftDeletes;
7+
use Illuminate\Support\Str;
78

89
class Survey extends Model
910
{
@@ -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)