key = $key; } /** * Send data to Appkeep */ public function sendEvent(AbstractEvent $event) { return Http::withHeaders($this->defaultHeaders())->post( config('appkeep.endpoint'), $event->toArray() ); } /** * Send scheduled task result */ public function sendScheduledTaskOutput(ScheduledTaskOutput $output) { return $this->sendEvent(new ScheduledTaskEvent($output))->throw(); } protected function defaultHeaders() { return [ 'accept' => 'application/json', 'authorization' => 'Bearer ' . $this->key, 'x-appkeep-client' => Appkeep::version(), ]; } }