url = config('fms_web_services.Error_Rate.url'); $this->channelName = 'fms_error_rate'; } public function setInputParameters(array $inputs): void { $this->inputParameters = $inputs; } /** * @throws Exception */ public function run(): array { try { return $this->sendRequest(); } catch (Exception $e) { Log::channel($this->channelName) ->error(get_class($this), [ 'message' => $e->getMessage(), ] ); throw $e; } } public function sendRequest(): array { return Http::withHeaders(['Content-Type' => 'application/json']) ->withBody(json_encode($this->inputParameters)) ->throw() ->withoutVerifying() ->post($this->url) ->json(); } }