toArray(); } return new Response( status: $statusCode->value, headers: [ 'Content-Type' => 'application/json', ], body: json_encode($data, JSON_THROW_ON_ERROR) ); } }