| foreach ($response->data as $key => $r) { | foreach ($response->data as $key => $r) { | ||||
| $work_order = WorkOrder::where('wo', $r->wo)->first(); | $work_order = WorkOrder::where('wo', $r->wo)->first(); | ||||
| if(!empty($work_order)){ | |||||
| $form_submitted = Form::where('_id', $work_order->_id)->first(); | $form_submitted = Form::where('_id', $work_order->_id)->first(); | ||||
| $form_submitted->customer_category = $r->category; | $form_submitted->customer_category = $r->category; | ||||
| $form_submitted->save(); | $form_submitted->save(); | ||||
| } | |||||
| } | } | ||||
| return 'data inserted '; | return 'data inserted '; |