We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9627a8e commit c8215d1Copy full SHA for c8215d1
src/app/Models/Survey.php
@@ -2,6 +2,7 @@
2
3
namespace AidynMakhataev\LaravelSurveyJs\app\Models;
4
5
+use Illuminate\Support\Str;
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Database\Eloquent\SoftDeletes;
8
@@ -25,7 +26,7 @@ public static function boot()
25
26
parent::boot();
27
28
static::creating(function ($survey) {
- $survey->slug = str_slug($survey->name);
29
+ $survey->slug = Str::slug($survey->name);
30
31
$latestSlug = static::whereRaw("slug = '$survey->slug' or slug LIKE '$survey->slug-%'")
32
->latest('id')
0 commit comments