From c17c35ec21c3d73d932c0e98a5a57a0c5feda2a9 Mon Sep 17 00:00:00 2001 From: A1Gard Date: Sun, 10 Dec 2023 11:58:44 +0330 Subject: [PATCH] add limit to sub cat --- app/Helpers/Helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index d298f9b..6a40fd1 100755 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -455,9 +455,9 @@ function getProductByCatQ($id, $order = 'id', $limit = 10) * @param $id * @return Cat[]|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection|\LaravelIdea\Helper\App\Models\_IH_Cat_C */ -function getSubCats($id) +function getSubCats($id,$limit = 99) { - return Cat::where('parent_id', $id)->get(); + return Cat::where('parent_id', $id)->limit($limit)->get(); } /***