From 491fd2fa8dd44235c6bcd5738746664888491b3c Mon Sep 17 00:00:00 2001 From: Clement Date: Fri, 25 Sep 2020 10:16:56 +0200 Subject: [PATCH] :sparkles: Permet la recherche dans la description --- app/Home.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Home.php b/app/Home.php index 53d28d2..ef2be01 100644 --- a/app/Home.php +++ b/app/Home.php @@ -29,7 +29,9 @@ class Home extends Model implements Feedable public function scopeComment(QueryBuilder $query, $comment): QueryBuilder { - return $query->where('comment', 'LIKE', '%'.$comment.'%'); + return $query + ->where('comment', 'LIKE', '%'.$comment.'%') + ->orWhere('description', 'LIKE', '%'.$comment.'%'); } public function scopePriceMax(QueryBuilder $query, $price): QueryBuilder