From 822cf3a85b10c799e41bb281f66fadc735a617fc Mon Sep 17 00:00:00 2001 From: Herbert Maschke Date: Tue, 4 Oct 2022 11:12:19 +0200 Subject: [PATCH] PostScope: also search in 'slug' column --- src/Models/PostScope.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/PostScope.php b/src/Models/PostScope.php index 3731e49..be73263 100644 --- a/src/Models/PostScope.php +++ b/src/Models/PostScope.php @@ -69,7 +69,7 @@ public function scopeSearch($query, $term) } return $query->where(function ($query) use ($term) { - foreach (['title', 'content', 'description'] as $attribute) { + foreach (['title', 'slug', 'content', 'description'] as $attribute) { $query->orWhere(DB::raw("lower($attribute)"), 'like', "%$term%"); }