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);