query = $query; return $this; } /** * Set the Webhook data to be JSON encoded. * * @param mixed $data * @return $this */ public function data($data): self { $this->data = $data; return $this; } /** * Add a Webhook request custom header. * * @param string $name * @param string $value * @return $this */ public function header($name, $value): self { $this->headers[$name] = $value; return $this; } /** * Set the Webhook request UserAgent. * * @param string $userAgent * @return $this */ public function userAgent($userAgent): self { $this->headers['User-Agent'] = $userAgent; return $this; } /** * Indicate that the request should be verified. * * @return $this */ public function verify($value = true): self { $this->verify = $value; return $this; } public function toArray(): array { return [ 'query' => $this->query, 'data' => $this->data, 'headers' => $this->headers, 'verify' => $this->verify, ]; } }