$a) { if($a->unit_no != '' || $a->unit_no != null){ $a->unit_no = strtoupper($a->unit_no); } if ($a->building_name != '' || $a->building_name != null) { $a->building_name = strtoupper($a->building_name); } if ($a->street != '' || $a->street != null) { $a->street = strtoupper($a->street); } if ($a->city != ''|| $a->city != null) { $a->city = strtoupper($a->city); } if ($a->state != ''|| $a->state != null) { $a->state = strtoupper($a->state); } $a->save(); } return "Done standardize city in DB"; } public function taggingCategory() { $response = json_decode(file_get_contents(public_path() . '/test.json')); if ($response->success == true) { foreach ($response->data as $key => $r) { $work_order = WorkOrder::where('wo', $r->wo)->first(); if (!empty($work_order)) { $form_submitted = Form::where('_id', $work_order->_id)->first(); $form_submitted->customer_category = $r->category; $form_submitted->save(); } } return 'data inserted '; } } public function updatePromoPrice() { $product = Product::where('formT', 'R')->where('speed', '50')->first(); $product->promotion_price = "69"; $product->save(); $product1 = Product::where('formT','R')->where('speed','100')->first(); $product1->promotion_price = "89"; $product1->save(); $product2 = Product::where('formT', 'R')->where('speed', '500')->first(); $product2->promotion_price = "129"; $product2->save(); $product3 = Product::where('formT', 'B')->where('speed', '50')->first(); $product3->promotion_price = "89"; $product3->save(); $product4 = Product::where('formT', 'B')->where('speed', '100')->first(); $product4->promotion_price = "119"; $product4->save(); $product5 = Product::where('formT', 'B')->where('speed', '300')->first(); $product5->promotion_price = "179"; $product5->save(); $product6 = Product::where('formT', 'B')->where('speed', '500')->first(); $product6->promotion_price = "249"; $product6->save(); return 'promo price update'; } public function resetDocket(Request $request) { $docket = Docket::where('docket_id',$request->docket_id)->first(); $work_order = WorkOrder::where('wo',$docket->work_order_id)->first(); $work_order->docket_id = ""; $work_order->status = "Pending Installer"; $work_order->save(); $claim = DealerClaim::where('docket',$request->docket_id)->first(); if(!empty($claim)){ $claim->forceDelete(); } $docket->forceDelete(); } public function getDatabase(Request $request) { $staff = Staff::where('api_token', '')->where('roles_access', 'Installer')->get(); return $staff; } }