invoiceninja / sdk-php

PHP wrapper for Invoice Ninja's REST API
https://www.invoiceninja.com
83 stars 41 forks source link

Add phone to client contact #50

Closed julios54-zz closed 4 years ago

julios54-zz commented 4 years ago

Purpose I wanted to create a client, but I had no way to add phone number on client contact, except the way to override Client model

Goal Be able to call method create() on models

$client = Client::create();
$client->name = 'Client name';
$client->addContact('humbert.julien54@gmail.com', 'Julien', 'HUMBERT', 'Phone number');
$client->save();

Changes Static create method on AbstractModel to bypass models constructors Add phone on client contact method

hillelcoren commented 4 years ago

Looks good, thanks!