shippingConfigRepo = $shippingConfigRepo; $this->labelConfigRepo = $labelConfigRepo; } public function index() { try{ $carrierRepo = new CarrierRepository(); $data['carriers'] = $carrierRepo->getActiveAll(); $pickupLocationRepo = new PickupLocationRepository(); $data['pickup_locations'] = $pickupLocationRepo->getActiveAll(); $data['conditions'] = $this->labelConfigRepo->all(); $data['row'] = $this->shippingConfigRepo->sellerConfig(); return view('shipping::configuration',$data); }catch(Exception $e){ Toastr::error($e->getMessage(), 'Error!!'); return response()->json(['error' => $e->getMessage()],503); } } public function update(ShippingConfigurationRequest $request) { try{ DB::beginTransaction(); $this->labelConfigRepo->update($request->only(['conditionIds','eCondition','conditions'])); $this->shippingConfigRepo->configuration($request->except(['_token','conditionIds','eCondition','conditions'])); DB::commit(); Toastr::success('Shipping Configuration Updated Successfully !'); return back(); }catch(Exception $e){ DB::rollBack(); Toastr::error($e->getMessage(), 'Error!!'); return response()->json(['error' => $e->getMessage()],503); } } }