SevenShores\Hubspot\Resources\Forms::update PHP Method

update() public method

Update an existing form.
See also: http://developers.hubspot.com/docs/methods/forms/v2/update_form
public update ( string $form_guid, array $form ) : Response
$form_guid string
$form array
return SevenShores\Hubspot\Http\Response
    function update($form_guid, $form)
    {
        $endpoint = "https://api.hubapi.com/forms/v2/forms/{$form_guid}";
        $options['json'] = $form;
        return $this->client->request('post', $endpoint, $options);
    }

Usage Example

Example #1
0
 /** @test */
 public function update()
 {
     $form = $this->createForm();
     $response = $this->forms->update($form->guid, ['name' => 'new name ' . uniqid()]);
     $this->assertEquals(200, $response->getStatusCode());
 }