diff --git a/app/Services/Cartables/Harim/FetchNewRequestsService.php b/app/Services/Cartables/Harim/FetchNewRequestsService.php new file mode 100644 index 00000000..144bedbd --- /dev/null +++ b/app/Services/Cartables/Harim/FetchNewRequestsService.php @@ -0,0 +1,42 @@ +url = config('cmms_web_services.MACHINE_INFO.url'); + $this->username = config('cmms_web_services.MACHINE_INFO.ViewName'); + $this->password = config('cmms_web_services.MACHINE_INFO.password'); + } + + 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() + { + return Http::post($this->url, [])->json(); + } +} \ No newline at end of file