From 1ecc314e8e206d467389e151048bb4f27a190082 Mon Sep 17 00:00:00 2001 From: sayliraut Date: Thu, 20 Jun 2024 18:42:40 +0530 Subject: [PATCH] change --- app/Services/APIs/CustomerAPIs/RestaurantApiServices.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Services/APIs/CustomerAPIs/RestaurantApiServices.php b/app/Services/APIs/CustomerAPIs/RestaurantApiServices.php index 636238b..f9af473 100644 --- a/app/Services/APIs/CustomerAPIs/RestaurantApiServices.php +++ b/app/Services/APIs/CustomerAPIs/RestaurantApiServices.php @@ -311,7 +311,7 @@ class RestaurantApiServices } - public function searchRestaurant($customerIamId, $request) + public function searchRestaurant($customerIamId, $request) { try { $restaurantsQuery = ManageRestaurant::with(['operatingHours', 'state']) @@ -334,6 +334,9 @@ class RestaurantApiServices foreach ($restaurants as &$res) { $res['image'] = ListingImageUrl('restaurant_images', $res['image']); + $res['is_favourite'] = CustomerFavouriteRestaurant::where('principal_xid', $customerIamId) + ->where('restaurant_xid', $res->id) + ->exists(); } return jsonResponseWithSuccessMessageApi(__('auth.restaurant_search'), $restaurants, 200);