首页 > 解决方案 > ErrorException 为 foreach() 提供的参数无效 - LAMP 堆栈

问题描述

       $settings = $this->post('settings', ['data' => ['all' => true]]);
       
       
       foreach ($settings as $k => $v) {
           if ($k == "payment_methods") {
               Cache::put('payment_methods', json_decode($v));
           } elseif ($k == "front_end_settings") {
               $frontEndSettings = \json_decode($v);
               foreach ($frontEndSettings as $k1 => $v1) {
                   Cache::put($k1, $v1);
               }
           } elseif ($k == "time_slot_config") {
               $v = \json_decode($v);
               if (($v->is_time_slots_enabled ?? 0) == 1) {
                   if (($v->time_slot_config ?? 0) == 1) { ...

我正在尝试为使用 LAMP 堆栈开发的名为 eCart 的电子商务工作应用程序托管此购买的 UI。我收到这个错误Invalid argument supplied for foreach() 。我不确定这里可能是什么问题

标签: ubuntuamazon-ec2apache2lamp

解决方案


推荐阅读