We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9627a8e commit fd70888Copy full SHA for fd70888
src/app/Models/Survey.php
@@ -4,6 +4,7 @@
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
+use Illuminate\Support\Str;
8
9
class Survey extends Model
10
{
@@ -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