updatesFreightForwarder = $updatesFreightForwarder; } public function execute(String $forwarderId, Request $request){ try{ $object = new FreightForwarderObject($request->input('shipping_rate'), $request->input('overdue_days'), $request->input('markup_percentage'), $request->input('minimum_cbm')); return $this->updatesFreightForwarder->execute($forwarderId, $object); return new JsonResponse([],HttpStatus::REQUEST_ACCEPTED); }catch(\Exception $exception){ throw new InternalServerErrorException("Failed to update Freight Forwarder because{$exception->getMessage()}"); } } }