src/Controller/RecipeController.php line 163

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Pimcore\Controller\FrontendController;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Contracts\Translation\TranslatorInterface;
  8. use Pimcore\Localization\LocaleServiceInterface;
  9. use Pimcore\Model\DataObject\Recipe;
  10. use Pimcore\Model\DataObject\Review;
  11. use Pimcore\Model\DataObject\RecipeIngredients;
  12. use Pimcore\Model\DataObject\Product;
  13. use Pimcore\Model\DataObject\RecipeTag;
  14. use Pimcore\Model\DataObject\UploadRecipe;
  15. use Pimcore\Model\DataObject;
  16. use Pimcore\Model\DataObject\Commentscount;
  17. use Pimcore\Targeting\VisitorInfoStorageInterface;
  18. use Pimcore\Model\Tool\Targeting;
  19. use Pimcore\Model\Tool\Targeting\TargetGroup;
  20. use Pimcore\Model\DataObject\UserRecipeActivity;
  21. use GeoIp2\Database\Reader;
  22. class RecipeController extends FrontendController {
  23.     /**
  24.      * @Template
  25.      *
  26.      * @param Request $request
  27.      *
  28.      * @return array
  29.      */
  30.     /**
  31.      * @var LocaleService
  32.      */
  33.     private $visitorInfoStorage;
  34.     public function __construct(VisitorInfoStorageInterface $visitorInfoStorage) {
  35.         $this->visitorInfoStorage $visitorInfoStorage;
  36.     }
  37.     public function recipesAction() {
  38.         
  39.         $Recipe = new Recipe\Listing();
  40.         $Recipe->setOrder("desc");
  41.         $Recipe->setLimit('4');
  42.         $Recipe->load();
  43.         $Tags = new RecipeTag\Listing();
  44.         $Tags->load();
  45.         $FeaturedRecipe = new Recipe\Listing();
  46.         $FeaturedRecipe->setCondition("featured IN (?)"'1');
  47.         $FeaturedRecipe->load();
  48.         $Products = new Product\Listing();
  49.         $Products->setLimit('3');
  50.         $Products->load();
  51.         $product = [];
  52.         foreach ($Products as $key => $Product) {
  53.             $product[] = $Product;
  54.         }
  55.         $recipe_reviews = new Review\Listing();
  56.         $recipe_reviews->setLimit('5');
  57.         $recipe_reviews->load();
  58.        
  59.         // Region wise ip Handler start
  60.          try {
  61.             $ipaddress '';
  62.             if (isset($_SERVER['HTTP_CLIENT_IP'])) {
  63.                 $ipaddress $_SERVER['HTTP_CLIENT_IP'];
  64.             } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  65.                 $ipaddress $_SERVER['HTTP_X_FORWARDED_FOR'];
  66.             } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
  67.                 $ipaddress $_SERVER['HTTP_X_FORWARDED'];
  68.             } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
  69.                 $ipaddress $_SERVER['HTTP_FORWARDED_FOR'];
  70.             } else if (isset($_SERVER['HTTP_FORWARDED'])) {
  71.                 $ipaddress $_SERVER['HTTP_FORWARDED'];
  72.             } else if (isset($_SERVER['REMOTE_ADDR'])) {
  73.                 $ipaddress $_SERVER['REMOTE_ADDR'];
  74.             } else {
  75.                 $ipaddress 'UNKNOWN';
  76.             }
  77.             if ($ipaddress != 'UNKNOWN') {
  78.                 $ip_info = new  Reader(__DIR__ '/GeoLite2-Country.mmdb');
  79.                 $record $ip_info->country($ipaddress);
  80.                 if ($record) {
  81.                     $ip $record->country->isoCode;
  82.                 }
  83.             }
  84.         } catch (\Exception $e) {
  85.             $ip '';
  86.         }
  87.         $code $ip// issign country-iso code to code varible
  88.         if ($code == 'AE') {
  89.             $groupids[] = '29';
  90.         } elseif ($code == 'SA') {
  91.             $groupids[] = '27';
  92.         } elseif ($code == 'OM' || $code == 'QA' || $code == 'KW' || $code == 'BH') {
  93.             $groupids[] = '28';
  94.         } else {
  95.             //$code = 'AE';
  96.             $groupids[] = '29';
  97.         }
  98.         $groupids[] = '22';
  99.        
  100.         
  101.         
  102.   
  103.         // Region wise ip Handler end     
  104.         return $this->render('Recipe/recipes.html.twig', [
  105.             'products' => $product,
  106.             'tags' => $Tags,
  107.             'featuredrecipe' => $FeaturedRecipe,
  108.             'recipes' => $Recipe,
  109.             'recipe_reviews' => $recipe_reviews,
  110.             'groupids' => $groupids,
  111.             'country' => $code,
  112.         ]);
  113.     }
  114.     public function allrecipesAction() {
  115.         $Recipe = new Recipe\Listing();
  116.         $Recipe->setOrderKey("o_id");
  117.         $Recipe->setOrder("desc");
  118.         $Recipe->load();
  119.         $Tags = new RecipeTag\Listing();
  120.         $Tags->load();
  121.         $recipe_reviews = new Review\Listing();
  122.         $recipe_reviews->load();
  123.         // $NewRecipes = new UploadRecipe\Listing();
  124.         // $NewRecipes->setCondition("status In (?)","ApprovePublished");
  125.         // $NewRecipes->load();
  126.         return $this->render('Recipe/allrecipes.html.twig', [
  127.             'tags' => $Tags,
  128.             'recipes' => $Recipe,
  129.             'recipe_reviews' => $recipe_reviews,
  130.             //'newRecipes'=>$NewRecipes,
  131.         ]);
  132.     }
  133.     public function recipedetailsAction(Request $request) {
  134.         // Region wise ip Handler start
  135.         try {
  136.             $ipaddress '';
  137.             if (isset($_SERVER['HTTP_CLIENT_IP'])) {
  138.                 $ipaddress $_SERVER['HTTP_CLIENT_IP'];
  139.             } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  140.                 $ipaddress $_SERVER['HTTP_X_FORWARDED_FOR'];
  141.             } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
  142.                 $ipaddress $_SERVER['HTTP_X_FORWARDED'];
  143.             } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
  144.                 $ipaddress $_SERVER['HTTP_FORWARDED_FOR'];
  145.             } else if (isset($_SERVER['HTTP_FORWARDED'])) {
  146.                 $ipaddress $_SERVER['HTTP_FORWARDED'];
  147.             } else if (isset($_SERVER['REMOTE_ADDR'])) {
  148.                 $ipaddress $_SERVER['REMOTE_ADDR'];
  149.             } else {
  150.                 $ipaddress 'UNKNOWN';
  151.             }
  152.             if ($ipaddress != 'UNKNOWN') {
  153.                 $ip_info = new  Reader(__DIR__ '/GeoLite2-Country.mmdb');
  154.                 $record $ip_info->country($ipaddress);
  155.                 if ($record) {
  156.                     $ip $record->country->isoCode;
  157.                 }
  158.             }
  159.         } catch (\Exception $e) {
  160.             $ip '';
  161.         }
  162.         $code $ip// issign country-iso code to code varible
  163.     
  164.         if ($code == 'AE') {
  165.             $groupids[] = '29';
  166.         } elseif ($code == 'SA') {
  167.             $groupids[] = '27';
  168.         } elseif ($code == 'OM' || $code == 'QA' || $code == 'KW' || $code == 'BH') {
  169.             $groupids[] = '28';
  170.         } else {
  171.             //$code = 'AE';
  172.             $groupids[] = '29';
  173.         }
  174.         // Region wise ip Handler end    
  175.         $url $request->get('url');
  176.         $recipedetails = new Recipe\Listing();
  177.         $recipedetails->setCondition("url = ?", [$url]);
  178.         $recipedetails->load();
  179.         foreach ($recipedetails as $key => $recipedata) {
  180.             $recipe $recipedata;
  181.             break;
  182.         }
  183.         $recipeid =   $recipedata->getId();
  184.         $reviews = new Review\Listing();
  185.         $reviews->setCondition("recipe_id__id IN (?)"$recipedata->getId());
  186.         $reviews->setOrderKey("o_id");
  187.         $reviews->setOrder("desc");
  188.         $reviews->load();
  189.         $reviewcount = [];
  190.         if ($reviews) {
  191.             foreach ($reviews as $key => $review) {
  192.                 $reviewcount[] = $review->getName();
  193.             }
  194.             $reviewcounts count($reviewcount);
  195.         } else {
  196.             $reviewcounts "0";
  197.         }
  198.         $commentscount = new Commentscount\Listing();
  199.         $commentscount->setlimit(1);
  200.         $commentscount->load();
  201.         $myRecipe = new Recipe\Listing();
  202.         //$myRecipe->setCondition("typeofmeal LIKE ?" , ['%Dessert%']);
  203.         $myRecipe->load();
  204.         $featuredrecipe = new Recipe\Listing();
  205.         $featuredrecipe->setCondition("url != ? and featured IN (?)", [$url'1']);
  206.         $featuredrecipe->setlimit(4);
  207.         $featuredrecipe->load();
  208.      
  209.         //Loyalty user activity
  210.         $userid $this->get('session')->get('loginUID');
  211.        // $recipeid = $recipe->getId();
  212.       
  213.        /* $Liked = new UserRecipeActivity\Listing();
  214.         $Liked->setCondition("recipeoption = ? and user_id__id = ? and recipe_id__id = ?", ['Like', $userid, $recipeid]);
  215.         $Liked->load();
  216.         if (count($Liked) == 1) {
  217.             $Likedcount = 1;
  218.         } else {
  219.             $Likedcount = 0;
  220.         }
  221.         
  222.         $Shared = new UserRecipeActivity\Listing();
  223.         $Shared->setCondition("recipeoption = ? and user_id__id = ? and recipe_id__id = ?", ['Share', $userid, $recipeid]);
  224.         $Shared->load();
  225.         if (count($Shared) == 1) {
  226.             $Sharedcount = 1;
  227.         } else {
  228.             $Sharedcount = 0;
  229.         }
  230.         $Saved = new UserRecipeActivity\Listing();
  231.         $Saved->setCondition("recipeoption = ? and user_id__id = ? and recipe_id__id = ?", ['Save', $userid, $recipeid]);
  232.         $Saved->load();
  233.         if (count($Saved) == 1) {
  234.             $Savedcount = 1;
  235.         } else {
  236.             $Savedcount = 0;
  237.         }*/
  238.         //Loyalty user activity ends
  239.         return $this->render('Recipe/recipesdetail.html.twig', [
  240.             'recipedetails' => $recipedata,
  241.             'ratingcount' => $reviewcounts,
  242.             'reviewcount' => $reviewcounts,
  243.             'count' => $commentscount,
  244.             'reviews' => $reviews,
  245.             'myrecipes' => $myRecipe,
  246.             'featuredrecipe' => $featuredrecipe,
  247.             'featuredreviews' => [],
  248.             'country' => $code,
  249.             //'country'=>'AE',  // temporary basses
  250.             'groupids' => $groupids,
  251.             'Likedcount' => 0,
  252.             'Sharedcount' =>0,
  253.             'Savedcount' => 0,
  254.         ]);
  255.     }
  256.     public function searchbytagAction(Request $request) {
  257.         $url htmlspecialchars($request->get('id'));
  258.         $Recipe = new Recipe\Listing();
  259.         // if($url == 'featured'){
  260.         //     $Recipe->setCondition("featured IN (?)", '1');
  261.         //     $id = $request->get('id2');
  262.         // }
  263.         $Recipe->load();
  264.         $Recipes = [];
  265.         $tagURL "";
  266.         foreach ($Recipe as $key => $recipe) {
  267.             for ($i 0$i count($recipe->getTags()); $i++) {
  268.                 if ($recipe->getTags()[$i]) {
  269.                     if ($recipe->getTags()[$i]->getUrl() == $url) {
  270.                         $Recipes[] = $recipe;
  271.                         if ($tagURL == "") {
  272.                             if ($request->getLocale() == 'ar') {
  273.                                 $tagURL $recipe->getTags()[$i]->getUrl("en");
  274.                             } else {
  275.                                 $tagURL $recipe->getTags()[$i]->getUrl("ar");
  276.                             }
  277.                         }
  278.                     }
  279.                 }
  280.             }
  281.         }
  282.         $Tags = new RecipeTag\Listing();
  283.         $Tags->load();
  284.         $recipe_reviews = new Review\Listing();
  285.         $recipe_reviews->load();
  286.         return $this->render('Recipe/recipesearchbytag.html.twig', [
  287.             'tags' => $Tags,
  288.             'recipes' => $Recipes,
  289.             'tagURL' => $tagURL,
  290.             'recipe_reviews' => $recipe_reviews,
  291.         ]);
  292.     }
  293.     public function searchAction(Request $request) {
  294.        
  295.         $q strip_tags($request->get('q'));
  296.         $Recipe = new Recipe\Listing();
  297.         $Recipe->setCondition("name LIKE ? or url LIKE ? ", ["%" $q "%""%" $q "%"]);
  298.         $Recipe->load();
  299.         $FeaturedProduct = new Product\Listing();
  300.         $FeaturedProduct->setCondition("featured IN (?)"'1');
  301.         $FeaturedProduct->load();
  302.         $Tags = new RecipeTag\Listing();
  303.         $Tags->load();
  304.         $RecipeIng = new RecipeIngredients\Listing();
  305.         $RecipeIng->load();
  306.         return $this->render('Recipe/recipe_searchby_name.html.twig', [
  307.             'tags' => $Tags,
  308.             'recipes' => $Recipe,
  309.             'name' => "Search query: $q",
  310.             'recipeingredients' => $RecipeIng,
  311.             'featuredproduct ' => $FeaturedProduct
  312.         ]);
  313.     }
  314.     /**
  315.      * @Route("/{locale}/reviews", name="recipe_review")
  316.      */
  317.     public function reviewAction(Request $request) {
  318.         $success 0;
  319.         $session $request->getSession();
  320.         if (empty($_POST['g-recaptcha-response'])) {
  321.             $success 1;
  322.             return $this->json(array('success' => $success));
  323.             // $session->getFlashBag()->add('recaptcha-error', 'Please check the the captcha form.');
  324.             // $this->addFlash('warning', 'Please check the the captcha form.');
  325.             // return $this->redirect($request->headers->get('referer').'#message-alertt');
  326.         }
  327.         $secret $secretdev '6LePrpohAAAAANEprm30tyI4ltm2Tcgw8kO_BbEV';
  328.         $url 'https://www.google.com/recaptcha/api/siteverify?secret=' urlencode($secret) .  '&response=' urlencode($_POST['g-recaptcha-response']);
  329.         // $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
  330.         $verifyResponse file_get_contents($url);
  331.         $responseData json_decode($verifyResponse);
  332.         if ($responseData->success == false) {
  333.             $success 1;
  334.             return $this->json(array('success' => $success));
  335.             // $session->getFlashBag()->add('recaptcha-error', 'Please check the the captcha form.');
  336.             // $this->addFlash('warning', 'Please check the the captcha form.');
  337.             // return $this->redirect($request->headers->get('referer').'#message-alertt');
  338.         }
  339.         if ($request->get('recipe_id')) {
  340.             $recipe Recipe::getById($request->get('recipe_id'));
  341.             try {
  342.                 $params = [
  343.                     'name' => $request->get('name'),
  344.                     'email' => $request->get('email'),
  345.                     'comment' => $request->get('comment'),
  346.                     'rating' => $request->get('rating'),
  347.                 ];
  348.                 $Review = new Review();
  349.                 $Review->setKey(strtotime(date('Y-m-d H:i:s')) . htmlspecialchars($request->get('email')));
  350.                 $Review->setParent(DataObject\Folder::getByPath('/Review/'));
  351.                 $Review->setName(strip_tags($request->get('name')));
  352.                 $Review->setEmail(strip_tags($request->get('email')));
  353.                 $Review->setComment(strip_tags($request->get('comment')));
  354.                 $Review->setRating($request->get('addreviewrating'));
  355.                 $Review->setRecipe_id($recipe);
  356.                 $Review->setPublished(false);
  357.                 $d $Review->save();
  358.                 if ($d) {
  359.                     $success 2;
  360.                     return $this->json(array('success' => $success));
  361.                     // $session->getFlashBag()->add('success', 'Thank you for your feedback.');
  362.                     // return $this->redirect($request->headers->get('referer').'#message-alertt');
  363.                 }
  364.             } catch (\Exception $e) {
  365.                 print_r($e->getMessage());
  366.             }
  367.         }
  368.         // $locale = $request->getLocale();
  369.         // if($locale == 'ar'){
  370.         //    return $this->redirect('/ar/كل-الوصفات/'.$request->get('recipe_url'), 301);
  371.         // }else{
  372.         //    return $this->redirect('/en/all-recipes/'.$request->get('recipe_url'), 301);
  373.         // }
  374.         return $this->json(array('success' => $success));
  375.     }
  376.     public function getadvancefiltermodal() {
  377.         $RecipeIng = new RecipeIngredients\Listing();
  378.       //  $RecipeIng->setCondition("featureingrident IN (?)", '1');
  379.         $RecipeIng->load();
  380.         $FeaturedProduct = new Product\Listing();
  381.         $FeaturedProduct->setCondition("featured IN (?)"'1');
  382.         $FeaturedProduct->load();
  383.         return $this->render('Recipe/advancefilterModal_includes.html.twig', [
  384.             'recipeingredients' => $RecipeIng,
  385.             'featuredproduct' => $FeaturedProduct,
  386.         ]);
  387.     }
  388.     /**
  389.      * @Route("/{locale}/filterrecipes", name="filterrecipes")
  390.      */
  391.     public function searchfilterAction(Request $request) {
  392.         // dd("hello");
  393.         if (count($request->query->all()) < 1) {
  394.             $referer $request->headers->get('referer');
  395.             return $this->redirect($referer);
  396.         }
  397.         $strBCond "";
  398.         $localCond "";
  399.         // $check = false;
  400.         $Recipe = new Recipe\Listing();
  401.         if ($request->get('product')) {
  402.             $product $request->get('product');
  403.             for ($i 0$i count($product); $i++) {
  404.                 if ($i 0) {
  405.                     $localCond .= " OR ";
  406.                 }
  407.                 //$localCond .= "product LIKE'%" . $product[$i] . "%'";
  408.                 $localCond .= "featured_product LIKE " $Recipe->quote("%," $product[$i] . ",%");
  409.             }
  410.             // $conn .= " OR ";
  411.             if ($localCond != "") {
  412.                 $strBCond " ( " $localCond " ) ";
  413.                 $localCond "";
  414.             }
  415.         }
  416.         if ($request->get('Ing')) {
  417.             $ingrident $request->get('Ing');
  418.             for ($i 0$i count($ingrident); $i++) {
  419.                 if ($i 0) {
  420.                     $localCond .= " OR ";
  421.                 }
  422.                 $localCond .= "ing LIKE " $Recipe->quote("%" $ingrident[$i] . "%");
  423.             }
  424.             if ($localCond != "") {
  425.                 if ($strBCond != "") {
  426.                     $strBCond .= " and ";
  427.                 }
  428.                 $strBCond .= " ( " $localCond " ) ";
  429.                 $localCond "";
  430.             }
  431.         }
  432.         if ($request->get('time60')) {
  433.             $localCond .= "time <= 60";
  434.         } else if ($request->get('time30')) {
  435.             if ($localCond != "") {
  436.                 $localCond .= " OR ";
  437.             }
  438.             $localCond .= "time <= 30";
  439.         } else if ($request->get('time15')) {
  440.             if ($localCond != "") {
  441.                 $localCond .= " OR ";
  442.             }
  443.             $localCond .= "time <= 15";
  444.         }
  445.         if ($localCond != "") {
  446.             if ($strBCond != "") {
  447.                 $strBCond .= " and ";
  448.             }
  449.             $strBCond .= " ( " $localCond " ) ";
  450.             $localCond "";
  451.         }
  452.         //Time End
  453.         //Serving Start
  454.         $servingParams = [];
  455.         if ($request->get('serving01')) {
  456.             array_push($servingParams1);
  457.             // $localCond .= "serving = 1 OR serving2 = 1";
  458.         }
  459.         if ($request->get('serving02')) {
  460.             array_push($servingParams2);
  461.             // if($localCond != ""){
  462.             //     $localCond .= " OR ";
  463.             // }
  464.             // $localCond .= "serving = 2 OR serving2 = 2";
  465.         }
  466.         if ($request->get('serving03')) {
  467.             array_push($servingParams3);
  468.             // if($localCond != ""){
  469.             //     $localCond .= " OR ";
  470.             // }
  471.             // $localCond .= "serving = 3 OR serving2 = 3";
  472.         }
  473.         if ($request->get('serving04')) {
  474.             array_push($servingParams4);
  475.             // if($localCond != ""){
  476.             //     $localCond .= " OR ";
  477.             // }
  478.             // $localCond .= "serving = 4 OR serving2 = 4";
  479.         }
  480.         if ($request->get('serving05')) {
  481.             array_push($servingParams5);
  482.             // if($localCond != ""){
  483.             //     $localCond .= " OR ";
  484.             // }
  485.             // $localCond .= "serving = 5 OR serving2 = 5";
  486.         }
  487.         if ($request->get('serving06')) {
  488.             array_push($servingParams6);
  489.             // if($localCond != ""){
  490.             //     $localCond .= " OR ";
  491.             // }
  492.             // $localCond .= "serving = 6 OR serving2 = 6";
  493.         }
  494.         if ($request->get('serving07')) {
  495.             array_push($servingParams7);
  496.             // if($localCond != ""){
  497.             //     $localCond .= " OR ";
  498.             // }
  499.             // $localCond .= "serving = 7 OR serving2 = 7";
  500.         }
  501.         if ($request->get('serving08')) {
  502.             array_push($servingParams8);
  503.             // if($localCond != ""){
  504.             //     $localCond .= " OR ";
  505.             // }
  506.             // $localCond .= "serving = 8 OR serving2 = 8";
  507.         }
  508.         if ($request->get('serving09')) {
  509.             array_push($servingParams9);
  510.             // if($localCond != ""){
  511.             //     $localCond .= " OR ";
  512.             // }
  513.             // $localCond .= "serving = 9 OR serving2 = 9";
  514.         }
  515.         if ($request->get('serving10')) {
  516.             array_push($servingParams10);
  517.             // if($localCond != ""){
  518.             //     $localCond .= " OR ";
  519.             // }
  520.             // $localCond .= "serving = 10 OR serving2 = 10";
  521.         }
  522.         // if($localCond != ""){
  523.         //     if($strBCond != ""){
  524.         //         $strBCond .= " and ";
  525.         //     }
  526.         //     $strBCond .= " ( ". $localCond ." ) ";
  527.         //     $localCond = "";
  528.         // }
  529.         //End Serving
  530.         //Start Cusine
  531.         if ($request->get('cusine')) {
  532.             $cusine[] = $request->get('cusine');
  533.             for ($i 0$i count($cusine); $i++) {
  534.                 if ($i 0) {
  535.                     $localCond .= " OR ";
  536.                 }
  537.                 $localCond .= "cusine LIKE " $Recipe->quote("%" $cusine[$i] . "%");
  538.                 $para[] = $cusine[$i];
  539.             }
  540.             if ($localCond != "") {
  541.                 if ($strBCond != "") {
  542.                     $strBCond .= " and ";
  543.                 }
  544.                 $strBCond .= " ( " $localCond " ) ";
  545.                 $localCond "";
  546.             }
  547.         }
  548.         $Recipes = [];
  549.         if ($strBCond != "") {
  550.             $Recipe->setCondition($strBCond);
  551.         }
  552.         $Recipe->load();
  553.         $Tags = new RecipeTag\Listing();
  554.         $Tags->load();
  555.         $recipe_reviews = new Review\Listing();
  556.         $recipe_reviews->load();
  557.         return $this->render('Recipe/advancefilter.html.twig', [
  558.             'tags' => $Tags,
  559.             'recipes' => $Recipe,
  560.             'name' => "Advance Search",
  561.             'recipe_reviews' => $recipe_reviews,
  562.         ]);
  563.     }
  564. }