*/ class WebhookRequestFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'webhook_endpoint_id' => WebhookEndpoint::factory(), 'method' => 'POST', 'request_uri' => '/hook/test', 'headers' => ['content-type' => ['application/json']], 'query_parameters' => [], 'body' => '{}', 'json_payload' => [], 'content_type' => 'application/json', 'body_size' => 2, 'ip_address' => '127.0.0.1', 'user_agent' => 'Webhook Inspector Test', 'received_at' => now(), ]; } public function forEndpoint(WebhookEndpoint $endpoint): static { return $this->state(fn (array $attributes): array => [ 'webhook_endpoint_id' => $endpoint->getKey(), ]); } }